[Templates] Trying to implement XVCL Frames using Template Toolkit

Josh Rosenbaum josh at infogears.com
Mon Jul 21 22:39:40 BST 2008


Glen Brydon wrote:
[SNIP]
> I know that I can define a [% BLOCK %] and even give it a name. The 
> problem is that a [% BLOCK %] is only visible withing the file it 
> appears and since any number of templates might want to [% INCLUDE %]
[SNIP]


This was really too long for me to read and comprehend it all and I'm not sure anyone else will take the time to read the novel. ;) I thought I would throw out a copy of ideas that might help you.

If you use PROCESS instead of INCLUDE, all BLOCK's in the PROCESSed file will still be available to you in your calling template. Of course variables may get whacked as well, so it may not work for you.

Predefining the blocks may help:
http://template-toolkit.org/docs/manual/Config.html#section_BLOCKS

Also, I believe there is (or used to be) an "EXPOSE_BLOCKS" option which allows you to process only a BLOCK from a TT file.
ie: [% PROCESS myfile.tt/myblock %]
Not sure if that is around or not anymore.

-- Josh



More information about the templates mailing list