Interesting... Morphing templates! I hadn't considered using filters
to change the variable names themselves. Thanks for the suggestion.
All best,
Josh
On Oct 21, 2005, at 3:29 PM, Mark A. Fuller wrote:
From: Josh Clark <[EMAIL PROTECTED]>
I imagine this is somewhat more expensive than includes.
Significantly so? Particularly in a CGI environment? Other downsides?
Something I like to do when I want to gain more reuse of template
fragments than feels comfortable with lots of includes is
preprocess the templates. (Or, if it seems like there's a lot of
one-time static setup of a page and I'm concerned about performance
issues.) For tags I want to preprocess I name them "<PREPROC_*>". I
have a little command line script to use H::T to load a template,
use the filter option to change all "<TMPL_*>" to some other value,
change "<PREPROC_*>" to <TMPL_*>, output the template, apply a
regular expression to change the original <TMPL_*> values back to
TMPL_*. I write the data to the real (run-time) template directory.
Another way to get creative with includes is use multiple
directories on the template path option. You can use variable
substitution to include templates from different directories at run
time. But, it sounds to me like what you're trying to do would
benefit more from preprocessing?
Mark
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads,
discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users