[Radiant] Custom Tags and Code reuse

Michael Jones mjfreshnspamfree at gmail.com
Tue Jan 16 14:45:11 CST 2007


> I believe you can just set tag.locals.whatever inside the do...end block.

I tried to set my locals to be the locals of the navigation tag like this:

 tag 'navigation_dynamic' do |tag|
   tag.render('navigation', {'urls' => 'Resources:
/resources/;Search: /resources/resources-search/;'}) do
       tag.locals.navigation = tag.locals.navigation_dynamic
   end
 end

I got the error about including a 'normal tag', I tried a few
different approaches such as:
tag.locals.navigation = {:normal=>'yo'}

The navigation tag in the standard_tags.rb is kinda trick, could you
explain the first line some?

hash = tag.locals.navigation = {}
tag.expand
   raise TagError.new("`navigation' tag must include a `normal' tag")
unless hash.has_key? :normal

Also, is there a good way to log debugging from the tags?

Thanks-
Michael



More information about the Radiant mailing list