wiki:quintagroup.dropdownmenu

Version 36 (modified by olha, 13 years ago) (diff)

--

quintagroup.dropdownmenu

quintagroup.dropdownmenu package allows to build multilevel portal dropdown menu based on nested portal_actions categories inside portal_tab category as well as based on portal content structure.

Introduction

This package allows Plone websites display multilevel portal dropdown menu based on nested portal_actions categories inside portal_tab category. It also allows to define whether to put content tabs before or after action tabs, and a bit more... For details see below.

quintagroup.dropdownmenu allows to create multilevel portal navigation using CMF Action Category containers. But the requirement is to have a specially named Action for each Actions Category. The id of each such action must be build using the rule:

    action_id = prefix + category_id + suffix

where:

  • 'category_id' is id of correspondent CMF Action Category
  • 'prefix' defined in DropDownMenu configlet, default value -
  • 'suffix' defined in DropDownMenu configlet, default value - _sub

Notes

You may have actions/content-based tabs as deep as you wish, but then you'll need to tweek default dropdown menu css rules a bit, default css rules show only the first 4 levels of tabs

Requirement

Plone 3.x, Plone 4.0

Migration from qPloneDropDownMenu

In case qPloneDropDownMenu product was previously installed, it will automatically detect legacy settings, migrate it to a newly created settings registry and update portal_actions tool if required along with removing old portal_dropdownmenu one. Also installation procedure will uninstall qPloneDropDownMenu product itself (in case it's still installed) and clean up everything after it. Note: to successfully migrate old tabs it's required to have a valid html markup, otherwise migration procedure won't be able to move tabs correctly.

Installation

quintagroup.dropdownmenu can be installed as a Python package by adding it to eggs section of a buildout:

[instance]
....
eggs =
    ....
    quintagroup.dropdownmenu

Then Re-run buildout with:

   $ ./bin/buildout

Restart the Zope server with the following command in the terminal:

   $ ./bin/instance restart

Activate Plone Drop Down Menu via Quickinstaller in Plone: Site Setup -> Add-ons.

Configuration

After installation in Plone, you'll see DropDown Menu item under Add-on Configuration, that include the following setting options:

Usage

To create the following 3-level portal dropdown menu:

  • Go to ZMI -> portal_actions -> portal_tabs
  • Add CMFActions to represent navigation first-level items (ids: folder1, folder2) and CMF Action Categorys to include second-level navigation items (ids: folder1_sub, folder2_sub).

  • For every CMFAction you should specify: its Title - as it will be visible in Plone and its URL (Expression) - URL on a site where it will be linked to. URL should be provided in the following format:
string:${globals_view/navigationRootUrl}/folder1

where 'folder1' is id of the folder, located in the site root, to which this tab should be linked.

In case you want your tab to be linked to an object inside some folder, you should specify the entire path, for example:

string:${globals_view/navigationRootUrl}/folder1/subfolder/page1

  • Each CMF Action Category will include CMFActions - 2nd-level navigation items (ids: subfolder1, subfolder2,..) and CMF Action Categorys - containers for 3-rd navigation level (ids: subfolder1_sub, subfolder2_sub,..).

  • 2-nd level CMF Action Categorys will include CMFActions - 3rd-level navigation items (ids: subsubfolder1, subsubfolder2,..)

You can change items order by using Up/Down? buttons.

Note

Changes you make in portal_actions may not immediately appear in Plone interface right after being done - this is because menu is cached (for an hour). That's why to see your drop down menu at once - go to the RAM Cache control panel (site URL/@@ramcache-controlpanel) and clear cache.

Attachments (12)

Download all attachments as: .zip