[Zope3-dev] RFP: menu item ordering

pete at bcmpweb.com pete at bcmpweb.com
Sun Dec 14 23:29:22 EST 2003


Hi Jim,

My personal thought on this is that the ordering is the domain of
presentation. So I agree with the idea that ordering should be independant
of the definition, although there could be hints in the definition.

The only way I can think of this working is if we made some kind of
queryable interface to this.

I.e. Provide a mechanism to query the list of menu items and provide
custom filters and ordering based on the fields we define for each menu
item.

What springs to mind (without even contemplating what the data structure
for menu items is) is that if we had a ZCatalog of menu items (do they
still exist in Zope 3 I don't remember) that would solve the problem.

Of course we would then need some pretty clever query caching else this
would load a server up.

What do you think?

Have I missed some other suggestions on this thread?

Cheers,
Pete

>
> 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
>
>
> _______________________________________________
> Zope3-dev mailing list
> Zope3-dev at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-dev






More information about the Zope3-dev mailing list