Our site maintains a database of our page urls and relationships between
them. Inside our templates, I have a sub to lookup urls by page name,
apply any prefix due to skin (printer, text), and insert the proper URL.
So my template might be:
You can also <a href="[%Lookup("Your Account")%]">Check your account</a>
The problem is that if a page name is changed in the database, the
templates are now out of date. I'm adding a step to the build process
to record which pages link to which pages, and I'd like to modify the
script that changes the page meta data in the database so it went and
altered template files, changing Lookup targets appropriately.
For single templates, that works fine.
However if a template includes another, it gets sticky. Particularly as
we use "cascading" templates a lot here (basically a tree where if a
named file isn't present, it looks a level higher, and so forth,
allowing us to "override" default templates on given projects.
So I'm looking for someway to intercept calls to INCLUDE and PROCESS,
get the actual path to the file INCLUDE'd, and edit it, before allowing
the process to procede. I've got the Badger book, but so far I haven't
sat down to read through it, so a chapter reference would be great if
this is already answered.
Thanks in advance
--
SwiftOne / Brett Sanger
[EMAIL PROTECTED]
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates