Ask Bjoern Hansen <[EMAIL PROTECTED]> writes:
> [...]
> Now I am working on a site where most of the content is just "simple
> data".
>
> I would like to use a wrapper for the pages, not entirely unlike
> the PROCESS configuration directive would allow me to.
>
> However, I need to define some of the data inside the real template
> file. Some of it can be set via META, but other things are either
> dynamic or Just Too Big to not get clunky as a meta tag.
Sound familiar :-)
IMHO the PROCESS configuration directive is an ideal choice if you
want to avoid template "noise" in your content as much as possible.
My setup is rather similar to Randal's - but there is a difference:
Instead of having
[% WRAPPER style/${style} %]
[% PROCESS $template %]
[% END %]
I have
[% content = PROCESS $template %]
[% PROCESS style/${style} %]
This consumes some memory, but has the advantage that from within the
real file you can control everything including the selection of $style
with plain TT directives. The style template is practically a WRAPPER
(i.e. it expands [% content %] at some place).
In your real files you can set variables to control whether (or which)
headers and footers are to be included. Every variable you set in
$template can be accessed from your style files.
The downside: Every variable you set in $template can clobber the
variables you set before PROCESSing $template.
--
Cheers,
haj
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates