[Templates] New user & question regarding two-pass processing / persistent data

lmb lars@marowsky-bree.de
Sun, 12 Jan 2003 18:34:55 +0100


On 2003-01-12T09:14:51,
   "Randal L. Schwartz" <merlyn@stonehenge.com> said:

Hi Randal, thanks for your reply.

> You could do something similar... you just need to store the
> information obtained at build time into some data structure or plugin
> that you can grab at run time.  The only tricky part was processing
> the HTML files with TT just enough so that I could get at the meta
> info.  Here's what I came up with, essentially:

I _think_ what might work is to add a call in pre_process to load the data
from somewhere, and in post_process, to store it away again, and grab an
uptodate copy of the stash.

After the first run over the whole site, all metadata should be available, and
a second pass should generate the correct references etc.

I don't have a 'delivery time' per se as I'm only generating static pages.

And pre_process doesn't work as I expected it to. *sigh* [% DEFAULT %] vars
are visible, but no variables defined in the page; so it is not a one-one
equivalence to [% PROCESS header %] at the beginning of each page.

But all in all, very impressive ;-)


-- 
"I'm extraordinarily patient provided I get my own way in the end."
        -- Margeret Thatcher