The sub-templates are instantiated within a servlet's constructor, so I get
dynamic compilation. They use #extends to inherit their base layout from
the master template. For this to work, the master template must be
precompiled, as must any intermediate subsite template. I've found that
generally, I only use up to about 2 levels of inheritance: master template
<-- context template <-- many page templates.
I built a similar system but it is not as clean an I would like it to be:

My idea is to create a master template w/ a function call in the content area.

cheetah-
<td>
$getPageContent()
</td>

servlet.
def getPageContent(self):
t = self.pagetemplate
t.data = self.data
self.writeln(t)

There is a lot of extra plumbing initally, but you get the advantage of dynamic recomp the whole way through and the ability to theme the site very easily.
The bad is the fact that you lose the nice inheritance of templates features and the fact that you have to hold each template instance per thread in memory. That kind of limits the overall theming scalability.

-Aaron




-------------------------------------------------------
This SF.NET email is sponsored by: FREE SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
_______________________________________________
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel


Reply via email to