[Grok-dev] Re: five.grok and page templates

Wichert Akkerman wichert at wiggy.net
Mon Aug 4 04:37:35 EDT 2008

Philipp von Weitershausen wrote:
> Wichert Akkerman wrote:
>> Previously Martin Aspeli wrote:
>>> Hi,
>>> With a lot of help from Philipp, I made five.grok use 
>>> Products.Five.browser.pagetemplatefile.ViewPageTemplateFile today. 
>>> This is necessary to make it work with Plone, and I presume other 
>>> code that makes "Zope 2" assumptions as well, e.g. the user of 'here' 
>>> or reliance on Five's provider: expression support.
>>> We made this work by overriding the ITemplateFileFactory for the 
>>> '.pt' extension from grokcore.view and implementing a 
>>> ZopeTwoPageTemplate that extends PageTemplate and uses a 
>>> ViewPageTemplateFile in setFromFilename(). We also overrode render() 
>>> to do some aq wrapping and call the template in a different way.
>> Have you checked if this still works with z3c.jbot? That should be a
>> requirement before using something like this in Plone.
> z3c.jbot does heavy monkey patches to Zope itself. I'm not in the 
> business of tell you guys what to do, but I personally refuse to adjust 
> my code to be defensive against wild monkey patches like that. And I 
> think it'd be sad if a new requirement for Plone-related code was now 
> not to dare break something as fragile as that.

That's a perfectly understandable goal. I do not think z3c.jbot is useful 
for grok, which I see as aimed for pure z3 applications and not large 
reusable applications such as Plone.

For Plone it is essential that we have a simple way for people to customize 
templates. A way that does not require designers to learn zcml, the 
component architecture or any other technology that designers do not already 
know. z3c.jbot is a too which provides that. I see five.grok as being at 
least partially aimed at being used inside Plone, so I think this should at 
the very least be investigated.

> I'm also not sure what you're implying here. That five.grok-based views 
> should be customizable through z3c.jbot? I consider this a questionable 
> goal. With Grok-like configuration, views have become a cheap commodity 
> to produce. Which means it should also be much easier now to rely on the 
> Component Architecture for overriding existing functionality (something 
> z3c.jbot should've done in the first place).

It could not since it had to deal with existing Zope versions, which do not 
provide any hooks that z3c.jbot can use. If you introduce new hooks now they 
will not usable by Plone for one or two years and we need something in the 


Wichert Akkerman <wichert at wiggy.net>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.

More information about the Grok-dev mailing list