[Catalyst] Bypass TT wrapper

marcus baker marcus.baker at gmail.com
Mon Aug 21 22:53:51 CEST 2006


Yeah, I go about this by forwarding to a separate TT view that doesn't
use the wrapper, your indirection method can come in handy though
thanks.


2006/8/21, Daniel Westermann-Clark <dwc at pobox.com>:
> 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
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>



More information about the Catalyst mailing list