RE: [Templates] Pass page template data structure to library template?
[prev]
[thread]
[next]
[Date index for 2005/01/13]
Randal L. Schwartz wrote:
> >>>>> "Harald" =3D=3D Harald Joerg <haj@xxxx.x.xxxxx.xx> writes:
>=20
> Harald> main.tt basically contains
>=20
> Harald> [% content =3D PROCESS $template.name %]
> Harald> [% PROCESS wrapper %]
>=20
> Harald> This solution can't be all bad because it brought me=20
> a "brilliant"
> Harald> by Randal L. Schwartz at that time :-)
>=20
> 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 =3D Template->new({ WRAPPER =3D> 'wrapper.tt' ...
It's my understanding that in this scenario the specified WRAPPERs are
PROCESSed after the requested template (i.e. from the inside out), so
any variables you create/modify are still in the stash and visible to
your wrapper (e.g. navigation). I'm using this model successfully in my
project (I think...)
Jason
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates
 |
RE: [Templates] Pass page template data structure to library template?
Jason Gottshall 20:13 on 13 Jan 2005
|