[Grok-dev] Menu system

Christian Theune ct at gocept.com
Fri Oct 20 12:33:29 EDT 2006


Hi,

Martijn Faassen wrote:
> Christian Theune wrote:
>> I just had an experience that makes me wonder whether we should abstain
>> from re-using the Zope 3 menu system for grok. It's implementation seems
>> nasty: The interfaces aren't completely described and it makes
>> assumptions that actions of a menu always apply to the currently
>> published object ... As Jim pointed out that menus should be taken as a
>> pattern and re-implemented by different projects, well, we have an
>> opportunity here ...
> 
> I'd be happy to make something new & simple for this. Do you have ideas
> for simple powerful menu systems?

Partially. I've been sketching this out a bit with Zagy and after a
while I had the idea that the current approach is backwards.

To step back a bit:

We currently define menus as nested lists of actions. (views to be more
specific) However, when trying to find out whether an entry is active,
we blindly compare URL parts (the last segment to be correct).

This would be much more flexible and reliable on determining which menu
entries are active.

Another bit that I know is bad is the question: Where are menu items
defined: On the view, or on the menu?

This is important because the answer "on the view" makes it almost
impossible to sort the menus arbitrarily.

The answer "on the menu" makes it hard to keep the list in sync.

The answer "both" makes it hard to understand and deal with.

Summary:

We definitely need a tight binding between menu definitions and views to
allow efficient and reliable determination of accessible and activated
menu items.

I'm not yet sure how this will look like, maybe I'll sketch out
something GROKKY. ;)

> We should figure out how this project connects to grok; we could have a
> z3c.menu and then use this from grok (as a dependency), or make it be
> part of grok directly..

That's what I thought too.

Cheers,
Christian

-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - ct at gocept.com - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20061020/d66039ee/signature.bin


More information about the Grok-dev mailing list