On 14/02/2009, at 2:53 AM, [email protected] wrote:

>  But I'm
> curious, has anyone came up with a more elegant to support that kind  
> of
> dynamic per-document INCLUDE_PATH munging?
>
>
> Joy,
> `/anick
> -- 

We've done something very like this, with the adjustments in  
myApp::V::TT.pm (Catalyst app)
There is a standard INCLUDE_PATH, which is prepended with a list of  
directories that correspond (effectively) to the PathParts or segments  
of the URI, from leaf backwards:

[ qw{  tt/foo/bar/baz   tt/foo/bar   tt/foo   tt/base } ]

This gives us enormous flexibility to tweak the output at any level of  
the URL hierarchy. Even if your URL scheme isn't hierarchic, it's  
straightforward enough to come up with a variation on this that would  
suit.

The code is at $work, so I can't post it right now, but could if  
anyone was interested come Monday.

cheers
RET

______________________________________________________
Don't drink and derive.  Alcohol and calculus don't mix.



_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to