[Catalyst] Bypass TT wrapper

Daniel Westermann-Clark dwc at pobox.com
Mon Aug 21 16:25:20 CEST 2006


On 2006-08-21 15:37:13 +0200, Tobias Kremer wrote:
> I have set up a site which utilizes the TTSite defaults for
> providing a common header/footer using TTs wrapper mechanism. What
> if I want to bypass the header/footer for certain URLs?

The cleanest solution I came up with was to add one level of
indirection to the WRAPPER usage.

wrapper.tt:

[% DEFAULT wrapper = template.wrapper OR 'wrappers/default.tt' %]
[% WRAPPER $wrapper %]
  [% content %]
[% END -%]

wrappers/none.tt:

[% content %]

some/action.tt:

[% META wrapper = 'wrappers/none.tt' %]
<p>I'm naked!</p>

Then in my config I set the view's WRAPPER to 'wrapper.tt'.

Another solution you might consider is using a separate view that has
no default WRAPPER.  Then all you have to do is forward to that view.

-- 
Daniel Westermann-Clark



More information about the Catalyst mailing list