[Radiant] ERB in snippets or pages?

Oliver Baltzer oliver at nitro.glycer.in
Tue Jul 18 23:09:04 CDT 2006


On 16-Jul-2006 23:54 +0200, Andrew Hodgkinson was heard to say:
> John W. Long wrote:
> 
> > A filter may not be the best choice here. Filters don't have any concept
> > of where they are being used (the page or snippet). [ Use behaviors ]
> 
> Provided all pages using the snippet (via a layout or directly) use the
> ERB behaviour, all is well. However, what about a Not Found page or an
> archive? That would probably use the same layout as other pages in a
> site, which wants directly or via a Snippet to include ERB. But it
> already has the Not Found Behavior, so it can't have ERB Behavior too.

What I have done in the past is to create a page with the particular
behavior and then create a snippet that includes the page, this snippet can
then be included into every other page, while original page with the ERB
behavior is executed in the ERB behavior context and the current page you
are looking at in its own behavior context. Of course, instead of going the
way through a snippet you can use <r:include> directly.

Oliver
-- 
Oliver Baltzer
.web   > http://nobits.org/oliver/
.pgp   > 0x32B54706
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.radiantcms.org/pipermail/radiant/attachments/20060719/79e6d108/attachment.bin


More information about the Radiant mailing list