[Catalyst] selectively using the wrapper

Bill Moseley moseley at hank.org
Wed Sep 16 14:38:15 GMT 2009

On Wed, Sep 16, 2009 at 7:20 AM, Ascii King <tech at swattermatter.com> wrote:

>> [%
>>  META custom_wrapper =3D 'alt_wrapper.tt';
>>  META title =3D 'Alt Layout';
>> -%]
>> <!-- rest of template goes here -->
> I don't know how to set the template.custom_wrapper, though. I ended up
> just using a variable in the stash called custom_wrapper and then deleting
> the 'template.' from the example above.

Just like the example above.

> $c->stash->{custom_wrapper} =3D 'my_special_wrap.tt2';

In my mind the wrapper is a view issue, so I set the wrapper in the template
not in the controller.  I have a wrapper that is called for *every* page
that is used to build the page.

META is compile time, IIRC, so I use [% page.layout =3D 'foo' %] then in
wrapper.tt I have a CASE statement that
sets the wrappers based on page.layout set in the base template.

IIRC, I use page.layout (instead of say just "layout") because WRAPPER does
a shallow localization of the stash.

-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090916/32f48=

More information about the Catalyst mailing list