[Catalyst] Meta::Interpolate - caching weirdness

Matt S Trout dbix-class at trout.me.uk
Fri Nov 9 18:56:43 GMT 2007


On Fri, Nov 09, 2007 at 11:17:39AM -0500, Randy Moore wrote:
> Hi all,
> 
> Newbie here with my first big project under Catalyst.
> 
> I'm trying to use a TT plugin for Catalyst that allows template 
> variables to be used in [% META %] tags.  I found this on Tony Bowden's 
> page here (http://nothing.tmtm.com/archives/201) and he credits Jonas 
> Liljegren, so I'm guessing the code originated here 
> (http://astral.paranormal.se/perldoc/Para/Frame/Template/Plugin/Meta/Interpolate.html).
> 
> I've got it working.  This does just what I would expect:
> 
>    [% USE Meta::Interpolate %]
>    [% META title =  '-"${category.name} at Our Site"'  %]

I wouldn't advise it.

Everything else is going to assume that META is static, so caching of
resultant compiled templates and thus the values is to be expected.

Instead, dump the plugin and in your WRAPPER (I presume that's where you're
trying to use this) just do

[% template.title | tt %]

to eval it (or whatever the appropriate syntax is, I don't use META
noticeably myself ...)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst mailing list