I have a few pages that have similar layouts and include some blocks  
in common, but each page shows a slightly different subset of blocks.  
Imagine pages for accepting donations from different countries, with  
each page showing different sections for the different options that  
are available in each country (e.g. credit card, PayPal, wire  
transfer, check, etc.).  Just as an example.  :)

I was hoping to use a page template that defined the various blocks  
and allowed each individual page to pick and choose the blocks to  
include (rather than creating different templates for each block),  
something like:

In donate_page:

[% BLOCK donate_cc %]
(text describing how to donate via credit card)
[% END %]
[% BLOCK donate_pp %]
(text describing how to donate via PayPal)
[% END %]
...
[% WRAPPER page title = "Make a Donation - ${country}" %]
[% content %]
[% END %]

And then in, say, us.tt2:

[% WRAPPER donate_page country = "United States" %]
[% INCLUDE donate_cc %]
[% INCLUDE donate_pp %]
(other stuff)
[% END %]

When I try this, I get an error saying that the "donate_cc" block  
can't be found.  Do I have the whole wrapper concept inside-out in my  
head?  It wouldn't be the first time...  :)  I've also tried putting  
the shared blocks into a separate file and including that file from  
the wrapper and/or the individual page, but no luck.

Thanks in advance for any pointers...

Dustin


_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to