Jason Gottshall writes:
> Randal L. Schwartz wrote:
>
>>>>>>>"Harald" == Harald Joerg <[EMAIL PROTECTED]> writes:
>>
>>Harald> main.tt basically contains
>>
>>Harald> [% content = PROCESS $template.name %]
>>Harald> [% PROCESS wrapper %]
>>
>>Harald> This solution can't be all bad because it brought me a
>>Harald> "brilliant" by Randal L. Schwartz at that time :-)
>>
>>Yup, and I switched to that as my idiomatic top level. Works very
>>nicely... the content can nudge its wrapper.
>
>
> Now that there's a WRAPPER config option (as of v2.09a) , couldn't you
> just do:
>
> my $tt = Template->new({ WRAPPER => 'wrapper.tt' ...
Erm, yes. Indeed.
And it's even documented in the Config section of the TT manual.
So the correct answer to Garry's original question would have been:
Just set your variables from your page template. The wrapper
template will pick it up and pass it to all layout template
it calls.
That's the problem when quoting from memories. 2.09a was released
about one month after I had written my article. It never occurred to
me that the WRAPPER directive would do the same trick.
I think it's now my turn to say (quoting Randal)
Doh! Brilliant! /me bangs head on desk
Time for a site reimplementation....
It's amazing how many times in my life that I've over-engineered
a project and missed the obvious. :)
--
Sorry for the confusion,
haj
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates