Dustin Frazier wrote:
> [% 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...  :)

Better than having your head inside-out in a wrapper :-)

The key thing is that the stuff inside the [% WRAPPER %]..[% END %]
is processed *before* the wrapper.  So at that point, the blocks
don't exist.

 > 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.

That should work if you set the EXPOSE_BLOCKS option.  Say, put them
all in 'payments' and do this:

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

(or just create a payments directory and make them individual files,
then you don't need to EXPOSE_BLOCKS)

Hmmm... I just noticed that EXPOSE_BLOCKS is missing from the documentation.
My bad... I'll look into that.

Or you can do something like this:

   [% WRAPPER donate_page
         country = "United States"
         donates = 'cc pp'
   %]
   (other stuff)
   [% END %]

And then in the donate_page wrapper:

   [% BLOCK donate_cc %]...as before...[% END %]
   [% BLOCK donate_pp %]...as before...[% END %]

   [% WRAPPER page title = "Make a Donation - ${country}" %]
   [% PROCESS "donate_$type" FOREACH type IN donates.split %]
   [% content %]
   [% END %]

HTH
A

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

Reply via email to