[Zope-dev] A z3c.jbot without a monkey

Malthe Borch mborch at gmail.com
Fri Jan 18 10:35:58 EST 2008


The z3c.jbot package basically offers an easy way to provide template
overrides much like zope 2 skins. It addresses the common issue with
using a framework that already provides its own skin; you want to be
able to easily customize it.

In the current implementation, z3c.jbot monkeys its way into
zope.pagetemplate to easily allow overriding the template source file.

This is of course not optimal, but it works rather well. However, if we
routinely switch between different file sources, performance will
certainly suffer. This could happen if for instance a template override
was registered only for a certain layer (not currently possible, but
certainly desirable). At any rate, this could be fixed at the level of
the page template implementation.

Getting back to the monkey, perhaps it would make sense to formalize the
way a template object gets its source file. The template class could
adapt to an ``IFileSource`` implementation that would provide a filename.

If there was such an entry point, other template implementations such as 
z3c.pt could also play along.

But perhaps the whole idea is symptom treatment and there's no way forward.

Comments welcome, especially in the light of PLIP #216 in which the
z3c.jbot approach has been selected for inclusion in Plone*.

*) http://plone.org/products/plone/roadmap/216

\malthe



More information about the Zope-Dev mailing list