#91: Sections (global tabs) should support folder-based structures

Contents
  1. Motivation
  2. Proposal
  3. Implementation
  4. Risks
  5. Progress log
  6. Participants
by Alexander Limi last modified Jun 11, 2006 12:22 AM

Plone currently uses portal_actions to render what is the top-level navigation (aka. global tabs). This structure needs to support folders, as it is a navigation widget, but still retain support for actions, since there are use cases for that too.

Proposed by
Alexander Limi
Seconded by
Alec Mitchell
Proposal type
User interface
Repository branch
plip91-folder-based-sections
State
completed

Motivation

The current approach to global section tabs in a Plone site are to use portal_actions to supply the items. This has numerous problems:

  • There is no easy way for content managers to add new tabs to the top-level structure.
  • The design encourages a disconnect between the site structure and the top-level tabs, which is bad for many reasons.
  • If you want proper tooltips with description on the tabs, you have to wake up the actual object and get its description and put that in the title attribute.
  • In multilingual sites, it's hard to translate actions, since they need to be in the gettext file instead of being on the content itself, which means you have to edit files on the filesystem if you change a title of a document - which is clearly wrong.
  • It's very hard to re-order tabs in the actions interface (and it's also in the ZMI, which is not good since this is a content management task, not a developer task).

Proposal

  • Keep the existing actions support for people that need tabs that have special conditions or are not part of the top-level structure (there are legitimate use cases for this too)
  • Add rendering of the top-level folders as tabs at the top of the site
  • Cataloged property on which allows types to be blacklisted from navigational structures (they will still be visible in batch mode / folder listing) - there is a good use case for blacklisting items in the navigation that does not have anything to do with the workflow state.

Implementation

  • A method createTopLevelTabs defined in PloneTool will be used to generate a list of the toplevel folders using the same rules and methods as createNavTree. This list will contain a mapping that parallels that returned by the existing actions, along with additional keys (Description).
  • The global_sections template will be altered to append the list generated by the above method to the existing portal_tabs action list.
  • A boolean property exclude_from_nav can be added (through the property manager API) to any object, and a metadata field for this property in the catalog will be used to exclude those objects from the navigation portlet and the section tabs.

Risks

The blacklisting in navigation will eventually have to propagate to BaseObject in Archetypes. Right now, we will support it in the ATContentTypes types.

Progress log

Limi will work on this with Alec Mitchell - everything should be pretty straightforward and similar to the catalog-backed folder listings.

All listed features are complete. The 'exclude_from_nav' property currently has no UI for setting it. The ideal UI for this setting this property is yet to be determined.

Participants

Alec Mitchell
Alexander Limi