in reply to How to design website structure?

Mason and Template will be more "familiar" than HTML::Template as they allow you to embed code, macros, and mini-language directives. In TT2 (Template) you could have a structure like so-

[% PROCESS header.tt %] [% PROCESS ${variable_template_name_from_code}.tt %] [% PROCESS footer.tt %]

-and then pass the middle template name in your code. There are many ways to do this sort of thing and you'll need to read the docs carefully but you can already see how easy it is to organize templates into reusable parts.

Replies are listed 'Best First'.
Re^2: How to design website structure?
by dsheroh (Monsignor) on Feb 14, 2010 at 09:51 UTC
    Another option with TT is to use the WRAPPER setting.
    my $tt = Template->new(WRAPPER => 'wrapper.tt', ...); $tt->process('whatever.tt', ...);
    You then put your header/footer code into wrapper.tt and, wherever you want the body content to appear, insert [% content %]. If the header/footer are in separate files, as in YourMother's example, wrapper.tt would be:
    [% PROCESS header.tt %] [% content %] [% PROCESS footer.tt %]