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

Martin Aspeli optilude at gmx.net
Sun Aug 3 20:08:58 EDT 2008

Martin Aspeli wrote:

> Should we make five.grok.PageTemplate be a Zope 2 style page template? 
> Should we bother to hack up a view-aware ZopePageTemplate for use with 
> inline templates?

Actually, this was easier than I thought. I added a 
ViewAwareZopePageTemplate to five.grok.components that replicates the 
pt_getEngine() and pt_getContext() overrides from Five's 

I then added this to five.grok's __init__.py:

   # Override the one from grokcore.view so that we get Zope 2 semantics
   from five.grok.components import ZopeTwoPageTemplate as PageTemplate

The tests, including the old ftests, still pass, and I've added a test 
to show inline templates working with Zope 2 semantics.

Please review and tell me if this all makes sense! Is there a use case 
for sticking with zope.pagetemplate type semantics here?


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