[Zope3-dev] menu item ordering

Garrett Smith garrett@mojave-corp.com
Thu, 24 Apr 2003 10:49:47 -0500


Guido van Rossum wrote:

> I think there's a default ordering which goes from most specific to
> least specific.  This is useful (we hope) for e.g. the "tabs" where
> the tabs specific to the object type at hand are on the left and
> generic tabs that apply to all objects on the right.  E.g. when
> viewing ++etc++site, the "Services" tab (which applies only here) is
> on the left, and the "Introspector" tab (which applies to *all*
> objects AFAICT) is on the far right.  In between are tabs of medium
> applicability.=20

It does look this way -- I guess this was in the back of my mind, as I'd
tend to look on the left for the new stuff.

Just to throw out an idea, might it be better to do the opposite -- add
new tabs to the right instead of the left? As an arrogant westerner, of
course, I know everyone reads from left to right :-o which would tend to
make the tabs more "stable" (consistent?) for users.

>> - Can the order of these items be precisely controlled?
>=20
> For the "Add service" menu I managed to get them in alphabetically
> sorted order.  This is done in zope/app/browser/container/adding.py,
> class Adding, method addingInfo().  I suppose each of the menus has
> some associated Python code that is used to generate the menu items,
> and this code could sort them by whatever key is useful.

Aren't most menus defined in ZCML? Would it be useful to add a menu sort
directive to give developers control over this? I realize this opens up
a bit of complexity, but I can see this becoming an important issue for
UI folks.

  -- Garrett=20