[Templates] *pre* pre-processing using ttree

Dustin Frazier dustin.frazier@alumni.cmu.edu
Fri, 4 Aug 2006 17:32:34 -0700


This is a multi-part message in MIME format.

------=_NextPart_000_00CD_01C6B7EB.F90CC8C0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

I'm using TT2 and ttree (no custom Perl save a few simple macros) to build a
large static website.  I have a config template that I invoke for each
template via the pre_process directive in my ttree.cfg file.  I now have
some database code in that file which is relatively expensive to execute,
and the results don't change from template to template.  Is there some way
to setup a template which only runs once before all templates are processed?
I've thought about a two-step process involving a meta-template of sorts to
generate the template that has the global data, but it seems like there
should be a better way...
 
Thanks!
 
Dustin
 

------=_NextPart_000_00CD_01C6B7EB.F90CC8C0
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2900.2912" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D391071300-05082006><FONT face=3DArial size=3D2>I'm =
using TT2 and=20
ttree (no custom Perl save a few simple macros) to build a large static=20
website.&nbsp; I have a config template that I invoke for each template =
via the=20
pre_process directive in my ttree.cfg file.&nbsp; I now have some =
database code=20
in that file which is relatively expensive to execute, and the results =
don't=20
change from template to template.&nbsp; Is there some way to setup a =
template=20
which only runs once before all templates are processed?&nbsp; I've =
thought=20
about a two-step process involving a meta-template of sorts to generate =
the=20
template that has the global data, but it seems like there should be a =
better=20
way...</FONT></SPAN></DIV>
<DIV><SPAN class=3D391071300-05082006><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D391071300-05082006><FONT face=3DArial=20
size=3D2>Thanks!</FONT></SPAN></DIV>
<DIV><SPAN class=3D391071300-05082006><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D391071300-05082006><FONT face=3DArial=20
size=3D2>Dustin</FONT></SPAN></DIV>
<DIV><SPAN class=3D391071300-05082006><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_00CD_01C6B7EB.F90CC8C0--