[Radiant] Custom Tags and Code reuse
Sean Cribbs
seancribbs at gmail.com
Tue Jan 16 13:38:24 CST 2007
Michael,
I believe you can just set tag.locals.whatever inside the do...end block.
Sean
On 1/16/07, Michael Jones <mjfreshnspamfree at gmail.com> wrote:
>
> > To call out to another tag you can call render on a tag binding:
> >
> > tag 'child_urls' do |tag|
> > tag.render('children:each', 'limit' => '5') do
> > tag.render('url')
> > end
> > end
>
> Thanks that really helped, one other question:
>
> How do I pass locals into a tag I'm rendering from another tag?
>
> For example I want to create my own custom tag that dynamically
> generates the values for the <r:navigation> tag.
>
> It would go something like:
>
> tag 'navigation_dynamic' do |tag|
> #some code to generate string of urls
> tag.render('navigation', 'urls' => 'url string here')
> end
>
> The 'navigation_dynamic' would have the nested values that the
> 'navigation' tag expects, but how do I pass those in?
>
> Thanks-
> Michael
> _______________________________________________
> Radiant mailing list
> Post: Radiant at lists.radiantcms.org
> Search: http://radiantcms.org/mailing-list/search/
> Site: http://lists.radiantcms.org/mailman/listinfo/radiant
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.radiantcms.org/pipermail/radiant/attachments/20070116/60e5448d/attachment.html
More information about the Radiant
mailing list