List Info

Thread: nested wrappers and variables




nested wrappers and variables
user name
2006-06-08 06:50:41
Dustin Frazier wrote:
> If I try to reference the variable 'section' within a
page that uses the
> 'page' wrapper, it's not defined. 

Hi Dustin,

Wrappers work "inside-out".  The inner content
is processed first 
followed by the outer wrapper template.  So variables set in
the main 
template are visible in the wrapper, but not the other way
round.

The best general solution to this is to use a PRE_PROCESS
template as 
Cees suggests.  In answer to your question, yes, the
template variable 
is accessible right from the start so it's fine to put your
"IF 
template.name.match(...)" code in there.

HTH
A


_______________________________________________
templates mailing list
templatestemplate-toolkit.org
http://lists.template-toolkit.org/mailman/listinfo/t
emplates
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )