[Templates] Dual pass template processing

Dave Cross dave at dave.org.uk
Wed Jan 30 06:16:24 GMT 2008


Mark Knoop wrote:
> Hi
> 
> I am new to TT and haven't read the book yet so sorry if this is a daft 
> question.
> 
> I have been using my own template system (how predictable) for generating 
> XHTML pages but am considering whether to start using TT. One of the 
> features of my system is that one set of tags gets processed when the site 
> is built ie the pages are prerendered to an extent. The rest of the tags 
> then get processed at request time by my CGI script.
> 
> I guess if I used TT variables I could have all the tags processed first 
> time round, with some just being replaced by new ones to be processed at 
> request time but is there a smarter way to do this? Or am I worrying about 
> nothing?
> 
> Any thoughts much appreciated.

I did something like this several years ago. The secret is to use two 
different types of tags - one for each stage of the processing. You can 
use the [% TAGS ... %] directive to change which kind of tag is 
processed at a any time.

Let me know if you need any more details.

Dave...



More information about the templates mailing list