[Templates] stonehenge.com cutting over to Template from Mason
Harald Joerg
harald.joerg@fujitsu-siemens.com
06 Mar 2002 09:32:38 +0100
Perrin Harkins <perrin@elem.com> writes:
> Randal L. Schwartz wrote:
> > So how do I detect which URL maps to which link in this map, and
> > then fire that bar and everything up the chain?
>
> You probably saw this coming (I am a broken record), but I think this
> is an example of when you should use perl, not TT. It should be
> pretty easy to make a nice data structure for this, look up your place
> in it, and then hand the appropriate display data to TT.
OTOH, one could rather easily set up the data structure in TT in a
PREPROCESSed template. It is not as elegant as doing this in perl,
but I found it very convenient to write a macro which enters a new
document into the structure and then to call this macro for all the
documents in the PREPROCESSed template. Every document can then
access the data structure as if it had been created in perl.
--
Cheers,
haj