[Grok-dev] Using z3c.template in Grok

Souheil CHELFOUH trollfot at gmail.com
Fri Jan 8 03:44:00 EST 2010


Hello there,

As i'm the author or megrok.layout and megrok.pagetemplate and a
maintainer of megrok.menu, i'll respond to your interrogations, as I
got them myself, before coding it.
I took the deliberate choice, with Sylvain Viollon, to move away from
pagelets because I think they are limited and complex, while
megrok.layout is simplier and as a real "Layout" component to work
with.
As we did this, I tried to keep the pluggability idea behind
z3c.layout and z3c.templates, by introduction megrok.pagetemplates.
I chose also not to depend on z3c.templates and all this, because they
are unneeded dependencies and they are too tightly linked to take only
the interesting bit out of it.
Stephan Richter and I already had a discussion on the mailing list
concerning this matter and my point of view didn't change.

megrok.layout and megrok.pagetemplate are independant bits that can
work together. They are simple and based directly on grokcore
components and/or zope packages
It is my will to keep these sane, small, and independant.

Extending megrok.pagetemplate with your own package is probably the saner move.
However, we already have a menu initiative in the Dolmen project, and
we try to build a new package that would resolve grok people's usecase
about menus.
If you feel like you can share your usecase, we can maybe work out
something together. In a wider approach, if you can share your global
usecase, maybe we can find solutions.
I started a new package called "dolmen.menu", to experiment things.

- Souheil

2010/1/8 Jeroen Michiel <jmichiel at yahoo.com>:
>
> Hi,
>
> 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
> go.
> 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.
>
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev
>


More information about the Grok-dev mailing list