[Grok-dev] Re: five.grok and page templates
Martin Aspeli
optilude at gmx.net
Mon Aug 4 03:56:01 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.
I haven't.
I would definitely like it to work with z3c.jbot. However, z3c.jbot is
neither a part of Plone core, nor Zope core, nor anything else, is
fairly new, and does some deep monkey patching. I'm not comfortable
recommending it as a long-term solution to people who are new to Plone
yet, and I'm not comfortable committing Zope/Five/Plone to having to
support it indefinitely.
This discussion belongs elsewhere, but if we want z3c.jbot to be such an
official part of Plone that people take it into consideration when
working on Plone (or Five!) code, then we need to submit it to the usual
process of review and discussion and include it as a maintained, core
package. We can't test with every third party solution out there. This
isn't about quality or even ubiquity: It's about the processes we have
established to help de-risk new approaches for those who do not
regularly read lists like this and establish a stable, supported
platform that doesn't grow willy-nilly.
I personally like the z3c.jbot philosophy very much. Overriding
templates should be that easy. However, I'm not convinced that it is a
strategically sensible implementation, and there has been no real review
to prove me wrong, much as I'd love to be. In fact, I think
grokcore.view holds more promise as a base for making customisation
"that easy" in a less monkey patched way.
I will endeavour to test, though, and make adjustments to make z3c.jbot
work if required and reasonable. I'm also interested in making z3c.jbot
less hacky by proposing more robust changes to Zope (or Plone).
Martin
--
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book
More information about the Grok-dev
mailing list