[Catalyst] selectively using the wrapper

Denny 2009 at denny.me
Tue Sep 15 22:28:01 GMT 2009


On Tue, 2009-09-15 at 17:55 -0400, Ascii King wrote:
> I want to load a page, but not run it through the wrapper.  Can I shut 
> off the wrapper or specify different wrappers at different times?
> 
> I have read the Catalyst::View::TT doc, but it doesn't mention this.

Someone was nice enough to answer this question for me when I posed it
on the #tt channel on irc.perl.org earlier today, so it would be rude of
me not to pass on the answer:


===== wrapper.tt =====

[% 	IF template.custom_wrapper; 
		PROCESS $template.custom_wrapper;
	ELSIF no_wrapper || template.no_wrapper;
		content;
	ELSE;
		PROCESS 'default_wrapper.tt';
	END
%]


===== a_template.tt =====

[%
  META custom_wrapper = 'alt_wrapper.tt';
  META title = 'Alt Layout';
-%]

<!-- rest of template goes here -->


Add default and alt wrapper templates to flavour  :)

Hope that makes sense!

Regards,
Denny

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090915/91016962/attachment.pgp


More information about the Catalyst mailing list