[Grok-dev] menus

Lennart Regebro regebro at gmail.com
Mon Apr 23 15:31:24 EDT 2007

On 4/23/07, Martijn Faassen <faassen at startifact.com> wrote:
> Hi there,
> This is just to start off some investigation of menus, as I'm starting
> to feel the need for them.
> Zope 3 has a menu infrastructure I've used though never fully
> understood. I've been trying to digest this text about it:
> http://svn.zope.org/Zope3/trunk/src/zope/app/publisher/browser/menu.txt?rev=67630
> but I'm still trying to understand it.

Yeah, that seems like an overly complicated description.

> Hopefully we can reuse some of the infrastructure described there and
> translate it into Grok terms. It needs some thought thrown at it first
> though, as the patterns aren't entirely clear to me yet.

Well, as I understand it, you have menus, which are utilities, and
then you have items, which are adapters between the object
IBrowserRequest and the menu. You can also have submenuitems, which
are "pointers" to a new menu.

And you have a metho on the menu utilities that says "get the menu for
this object".

So, it should be quite straightforward, really. a grok.Menu, a
grok.MenuItem and a grok.SubMenuItem, all of which more or less only
need to subclass the zope3 objects that are already there. And a
grokker tyo register them automatically.

Or am I missing some complexity?

Lennart Regebro: Zope and Plone consulting.
+33 661 58 14 64

More information about the Grok-dev mailing list