[Zope3-dev] RFP: menu item ordering
Jim Fulton
jim at zope.com
Fri Dec 12 04:18:06 EST 2003
Zope 3 has a facility for creating browser menus:
- Products can define items to add to existing menus.
Menu definition is distributed.
- Menu items are filtered on a number of factors:
o The object the menu item is defined for.
Menu items are registered for specific interfaces.
Different objects will have different menu items
for the same menu.
o Permission: menu items have required permissions.
A menu item is ommitted if the user doesn't have the
required permission.
o Filter expressions: a menu item can have a tales expression.
The item is displayed only if the expression is true.
o Specialized menus may have other criteria. For example,
add menus now filter menu items based on containment constraints.
Currently, menu items are ordered using the following criteria:
- Items registered for more specific interfaces are shown before menu
items for less-specific interfaces.
- Items registered for interfaces with equivalent specificity are
displayed in the order they are defined in.
Note that we sometimes (e.g. for add menus) sort items on their titles.
The ordering is most important for the ZMI views menu, as the view
corresponding to the first item is displayed when you select an item in
the contents listing of a folder.
I have a feeling that there should be a way to provide greater control over
item ordering. I haven't thought of a good way of doing this.
I think that the thing that makes it hard is the distributed definition of
menu items.
In addition, I suspect it would be best to be able to specify the ordering
independent of the item definition. Of course, that makes it even harder.
Does anyone have any ideas?
If not, I guess we'll stick with what we have now.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the Zope3-dev
mailing list