I have used Template :: Toolkit for my last few Catalyst projects and have a setting that I like that allows a clean separation of my templates. Now I hope to use Text :: Xslate , but I am having problems determining if I can make the same settings or not. Below is what I usually use for Template :: Toolkit.
__PACKAGE__->config({ ... WRAPPER => 'site/wrapper', ... });
wrapper
[% content WRAPPER site/html + site/layout %]
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>[% template.title or site.title %]</title> <style type="text/css"> </style> </head> <body> [% content %] </body> </html>
location
<div id="header">[% PROCESS site/header %]</div> <div id="content"> [% content %] </div> <div id="footer">[% PROCESS site/footer %]</div>'
And then the header and footer have their own content. I like this solution because everything is clearly separated, and I don't break div tags around the content, putting the opening tag in the header and closing in the footer. There seems to be some shell functionality with TTerse syntax, but I'm not sure if this allows me to recreate what I usually do. I also found this answer , which says that you can use the shell in theory, but does not actually give any examples.
source share