[Templates] trying to leave HTML::Mason for TT2
Andy Wardley
abw@cre.canon.co.uk
Sat, 5 Aug 2000 11:46:02 +0100 (BST)
> trying to see if I'm investing my time wisely, and have so far only
> spent a few hours with the TT2 beta dist.
You might also want to grab a version 1.** copy, if you haven't
already got it, for the documentation. Although some things have
changed, and the V1 docs are far from perfect, they're more
complete than the V2 docs at this time.
> 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?
There's nothing built in at the moment, and as Perrin has already pointed
out, this might be something better positioned in front of the TT
process, rather than within it. But on the other hand....
> 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.
Hmmm... TT2 supports the 'META' directive which allows you to assign
metadata to a component. That would allow you to specify your caching
args within each template, for example:
[% META
title="Blah blah"
version=1.23
args="foo,bar,baz"
%]
We could use a Template::Provider derivative to look for those args
and return a cached result or an active template depending on what
might/not have changed.
Hmmm... leave it with me for a day or two and I'll mull it through
my head and see what comes out.
> And can we get the equivalent of inheritance?
In some form, yes, by using the INCLUDE_PATH as Perrin also mentioned...
> 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?
But no, there's no 'super' call, but it's one of those things that would
be very useful. Simon Matthews has mentioned this to me before and
he _may_ have a work-around. Again, let me have a think and I'll see
if there's something that can be done.
> 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. :)
12-page feature, eh? Very nice. You is truly net.famous. :-)
Keep firing away with any other questions you might have. There are
a whole bunch of things that TT2 could have, and probably should have,
but haven't necessarily occurred to me/us at the right time and place.
Cheers
A
PS And by the way, thanks for the Stonehenge part in case I was too drunk
to say so at the time... :-)