[Templates] trying to leave HTML::Mason for TT2
Randal L. Schwartz
merlyn@stonehenge.com
04 Aug 2000 15:59:28 -0700
Pardon me if these things would have been discovered in hour 4 of
reading through the docs and looking at the test code, but I'm just
trying to see if I'm investing my time wisely, and have so far only
spent a few hours with the TT2 beta dist.
www.stonehenge.com uses HTML::Mason right now. I like a lot of the
things I see in TT2. But I'm missing some basic things still.
How do I do the equivalent of the "autohandler" and "defaulthandler"
under mod_perl? I think I can write a mod_perl handler that looks for
a PerlSetVar TTAutoHandler and if present, invokes that template
instead of the file directly. However, is there a consistent way to
tell that template what the original file was? I suppose I could just
pass "$r" as one of the vars, and pull them out?
And what about caching the results of calculations? Has anyone done a
cache plugin, or had experience using any of the dozen caching
solutions in a multiuser environment to share the results? And is
there a natural idiom to have a template component cache its own
result based on things to consider, like input parameters or time of
day? I'd like to keep the caching rules with the component, not with
all of the component's users.
And can we get the equivalent of inheritance? My webtechniques
columns have distinct content, but they should have common wrappers,
and those wrappers should be like all columns, and all columns should
be like the pages in my site. So there's four levels of "templating".
And who calls who? Should the specific page call the outer pages,
which call back to the specific page? Or can I have the specific page
do the equivalent of "super" calls to get the outer wrapper stuff?
Can I open a file and include it arbitrarily, rather than have it
examined via INCLUDE for template codes? I suppose I could set the
template triggers to be something very unlikely, but is there a way of
just saying "put this file here"?
Those are my first questions. I'd like to roll out a new site design
before the 12-page Wired article about me hits in mid-September, so
there's some urgency here. :)
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!