[Radiant] Behavior vs. Context

Jay Levitt lists-radiant at shopwatch.org
Thu Jul 27 11:15:52 CDT 2006


Sean Cribbs wrote:
> John et al,
> 
> In an effort to extend Radiant for my own needs, I have discovered that 
> I need to create some Radius tags.  Ideally, I'd like these to be part 
> of the PageContext class, but I'm not sure how to go about it (should I 
> alias/override initialize?).  I'd be willing to settle for a behavior, 
> but since a page can only have a single behavior, and the tags are more 
> like utilities, I'm not sure it's appropriate.  How should I proceed? 
> Are there best practices for this sort of thing?

I've been doing this via a plugin, as follows:

class Behavior::Base
   define_tags do
     tag "slicktabs" do |tag|
       slicktab = SlickTabs.new(tag)
       slicktab.output
     end
     ...other tags...
   end
end

class SlickTabs
   ...
end



> 
> TIA
> 
> Sean Cribbs
> seancribbs.com <http://seancribbs.com>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Radiant mailing list
> Radiant at lists.radiantcms.org
> http://lists.radiantcms.org/mailman/listinfo/radiant




More information about the Radiant mailing list