A customizable dropdown menu
Customizable navigation menu for Plone. Features include:
- Manually defining entries for the navigation menu
- Setting conditions on single entries
- Generating a submenu automatically by reading the contents of a given folder
- Generating a submenu manually from static pages
- Both submenu types can exist for a single entry
- No opinionated styles for the menu. Give it your own style in your site theme.
- Handles multiple configurations, bound to different paths. Useful for handling subsites, for example.
This is how the control panel looks like:
Below the title you can find tabs. Each tab holds the configuration for a single path. We will go into detail about this later, for now we will work on the main tab, which has the name of the current Plone site.
The path field holds the root path of this configuration. Every path under this one will use this menu.
Following the path field there is a list of menu items (only one is shown in the picture). Each menu item is a collapsible, sortable (by dragging up and down) and removable fieldset of five fields.
tab_title is the title of the menu entry. It’s the string that will be printed on the main navigation menu.
Navigation folder is the path of the folder from which we can automatically generate a submenu.
Additional columns is the path of a folder that contains pages. The text of the pages will be added in the generated submenu. This can be used in addition to the Navigation folder field, for example to add an image to the generated submenu, but can also be used alone, to generate a static customized submenu.
If we use one or both the previous fields, the main navigation link will toggle the collapsible submenu that was generated.
Simple link overrides the previous two fields and can be used to create a simple link to a specified url.
Condition is an expression that is verified to decide whether to show the menu entry. Defaults to python: True when creating new entries, can be changed to python: False to hide the entry, as a basic configuration, but more complex expressions are allowed. See a complete list here: http://docs.plone.org/develop/plone/functionality/expressions.html#expression-variables
After the entries list, you can find another button (Add item) that adds a new menu entry.
Three different custom events will be fired from the menu links:
- editablemenu.submenu.opened: when the menu finishes sliding down
- editablemenu.submenu.closed: when the menu finishes sliding up
- editablemenu.submenu.loaded: when the menu finishes loading new content
Install collective.editablemenu by adding it to your buildout:
[buildout] ... eggs = collective.editablemenu
and then running “bin/buildout”
This add-on has been tested on Plone versions 5.0 and 5.1.
For Plone 4 compatibility, use version 0.10.2 (a dedicated branch is coming soon…)
Upgrading old versions
From 2.1.0 version, we drop an old unused configuration that has been replaced since 2.0.0. To do this, we needed to delete some unused code/interfaces.
If you have very old versions of this product (< 0.10.0) you should install 2.0.0 version and perform upgrade-steps, before installing the latest one.
In this product there are several static resources:
- sass styles
- React app for the configuration menu
- Js for the rendered menu
To compile the widget configuration app:
Go to src/collective/editablemenu/browser/static/js/widget folder.
Then install dependencies:
And finally compile React app:
After that, you need compile all the resources and bundle them for resource registries bundles:
Go in the project’s root and install dependencies for Grunt:
And finally compile and uglify the resources:
npm run compile
- Issue Tracker: https://github.com/RedTurtle/collective.editablemenu/issues
- Source Code: https://github.com/RedTurtle/collective.editablemenu
The project is licensed under the GPLv2.
- RedTurtle Technology, firstname.lastname@example.org
- Added the options to customize dynamic sections labels [pnicolli]
- Add python3 support. [cekk]
- Fixed submenu_detail_view.pt so that condition do not call folder object. [eikichi18]
- Don’t break the viewlet if the context is not in the structure mapping. [cekk]
- Remove unused classes/interfaces for old-style registry entries from code. See the README for upgrading informations (only if you came from < 0.10.0). [cekk]
- Rewrote menu templates to improve accessibility [pnicolli]
- Handled aria-expanded and ESC keypress event via ES [nzambello]
- Remove unused old code [cekk]
- Fix menu render when there are no settings for the current folder [cekk]
- Add initial test suite (functional and acceptance)
- Add test suite (functional and acceptance) [cekk]
- Added custom events when the menu is opened, closed and loaded [pnicolli]
- Fixed deprecated plone.directives.form import [pnicolli]
- Fix zcml condition for registering the global_sections viewlet. It was adding two different viewlets simultaneously on Plone 5, now one of those is gone. [pnicolli]
- plone.protect js script was being added to the submenu html, now it’s removed manually from the async response. [pnicolli]
- Moved configuration format to using a json string [daniele-andreotti]
- Completely new controlpanel layout [pnicolli]
- Fix choose_site_menu_config method to take the right path [fdelia]
- Fix url generation for simple_link field. Now can handle correctly both internal or external links. [cekk]
- Fix upgrade steps [lucabel]
- BREAKING: Submenus are now created inside the menu <li> element, instead of after the whole <ul> [pnicolli]
- Added Dexterity support for the static portion of the menu [pnicolli]
- Page template now loaded inside the class to allow easier viewlet cloning [pnicolli]
- Add simple “not expansible” link in menu [lucabel]
- Add possibility to condition tab visibility the same way portal_tabs did it [lucabel]
- Add Plone5 compatibility (no resourse registry) [cekk]
- Fix MANIFEST.in and trove classifiers in order to release package on PyPI [ale-rt]
- Fix js call [cekk]
- Fix registry problems [cekk]
- Initial release. [cekk]
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size collective.editablemenu-2.3.0.tar.gz (473.5 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for collective.editablemenu-2.3.0.tar.gz