[Grok-dev] Using z3c.template in Grok

Jeroen Michiel jmichiel at yahoo.com
Fri Jan 8 03:28:55 EST 2010


I'm wondering if there is a grok-version of z3c.template around somewhere?
I rummaged around on PyPI, but I'm a bit confused.

Let me first tell you what I'm actually trying to do:
I tried to refactor my current site layout from a macro-based thing to
pagelet based, and I wanted to use z3c.menu.ready2go instead of megrok.menu,
as the latter seems too restricted for my purposes.

For the layout part, I found megrok.layout and megrok.pagelet. Both seem to
basically do the same. But as megrok.pagelet is only at version 0.1, and
megrok.layout at 0.9 (and more recent) I figured megrok.layout is the way to
Does megrok.pagelet have any advantage/different use case over
megrok.layout? If not, shouldn't it be better to mark it deprecated? It
states to be 'z3c.template / z3c.layout support for Grok', but that seems
incorrect, because I don't find anything like z3c.template in there.

For the menu's, I started to use z3c.menu.ready2go, and got it working.
However, it uses z3c.template to register it's templates. It works out of
the box, but now I want to override the template used for the menu items
(item.pt) with my own (because I want to use a YUI menu), and that's where I
would need an easy way to register a template in grok, the z3c.template way.
I noticed a package called megrok.pagetemplate (based on zope.pagetemplate),
that already does the basics, but it only knows an IPageTemplate, while
z3c.template has derived IContentTemplate and ILayoutTemplate from that, and
z3c.menu.ready2go looks up an IContentTemplate for the item template.

So what are my options here? Extend megrok.pagetemplate to support
IContentTemplate and ILayoutTemplate (or is there someone who would want to
do this for me ;-) )? Do some dirty adapter registrations myself?

I'm a bit clueless, here, so any advice is welcome!
View this message in context: http://old.nabble.com/Using-z3c.template-in-Grok-tp27072769p27072769.html
Sent from the Grok mailing list archive at Nabble.com.

More information about the Grok-dev mailing list