How to use multiple TTSite views for the Template Toolkit on a Catalyst site?

I use the Template Toolkit to create page views in Catalyst. To make some basic Ajax, I want some output pages not to use the TTSite style, but a much more basic structure. Am I putting something special in stash to use the .tt2 file without the header / footer / etc, which comes automatically with my rest templates? (The site was created after the instructions.)

+4
source share
1 answer

Aha, lib / projectname / View / TT.pm has:

WRAPPER => 'site/wrapper', 

and in root / lib / site / wrapper, I find:

 [% IF template.name.match('\.(css|js|txt)'); debug("Passing page through as text: $template.name"); content; ELSE; debug("Applying HTML page layout wrappers to $template.name\n"); content WRAPPER site/html + site/layout; END; -%] 

So, if I name my .txt template without a shell, I can avoid site / html + site / layout.

Or maybe even better, I can make the .ajax extension and add it to the list of pass-through templates.

+3
source

All Articles