There are many ways to do it; here's one way that is similar to what you are
asking to do.
<template>
[% IF block1 -%]
Some [% block1.var %] here
[% END%]
[% IF block2 -%]
Some [% block2.var %] here
[% END %]
[% IF block3 -%]
Some [% block3.var %] here
[% END %]
<end template>
Then you just choose which blocks you want to use like so:
$tt->process($template, { block1 => data })
Or
$tt->process($template,
{
block1 => \%data1,
block2 => \%data2,
block3 => \%data3,
}
);
You could also use a header and footer template that you INCLUDE into your
main template.
- Mark.
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates