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

Philipp von Weitershausen philipp at weitershausen.de
Mon Aug 4 03:32:17 EDT 2008


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.

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).


More information about the Grok-dev mailing list