Reference π#
Behavior field π§©#
Interface:
cs.megamenu.behaviors.menu.IEditableMenuBehavior name:
cs.megamenu.menuFieldset:
megamenu(label Mega menu)Field:
menu(plone.schema.JSONField)Default:
None(inherit)
The behavior is enabled on Plone Site and Folder by the default profile.
LRF is enabled when the type exists. To define additional menu fields, see
Additional menu fields.
JSON value ποΈ#
{
"version": 1,
"items": []
}
Every item has id, type, title, css_class, and icon.
Folder items have children and no target. Link items have exactly one of
internal_uid / external_url, plus open_in_new_tab, and no children.
Constraints:
Field |
Rule |
|---|---|
|
UUID string, unique across the tree |
|
|
|
required, trimmed, at most 200 characters |
|
CSS class list, at most 200 characters |
|
Plone icon name (letters, numbers, |
|
non-empty string, at most 64 characters, resolved on save |
|
at most 2048 characters; |
|
boolean on links |
Unknown properties are rejected. Empty menus and empty folders are valid. Duplicate titles are allowed; duplicate IDs are not.
Validation β #
Client-side validation mirrors the server rules and shows inline errors in the
editor. Server-side validation is a MenuValidator registered for the menu
field and raises newline-separated, path-aware messages such as:
Products β Product A: Choose exactly one target: internal or external.
Linkintegrity π#
Internal menu links are registered with plone.app.linkintegrity when the menu
is saved. Deleting a referenced target shows Ploneβs standard βPotential link
breakageβ confirmation, naming the object that stores the menu.
Works for menus on Plone Site, Folder, and LRF.
Inherited menus are attributed to the ancestor that stores the menu.
Only
internal_uidreferences are tracked; external URLs are not.Soft dependency: if
plone.app.linkintegrityis absent orenable_link_integrity_checksis off, menus still work without warnings.Existing menus are registered on their next save; there is no backfill.
A menu link whose target is the Plone Site root itself is not tracked.
Viewlet π§#
Replaces
plone.global_sectionsinplone.mainnavigation.Registered for
cs.megamenu.interfaces.IBrowserLayer.Permissions:
zope2.View.
Custom rendering π§©#
For custom markup, use cs.megamenu.menu.get_menu(context) and
filter_items(). See
Custom menu rendering for the return
contract and a complete example.
Bundle π¦#
Registry prefix:
plone.bundles/cs.megamenuCompilation:
++plone++cs.megamenu/bundles/cs.megamenu-remote.min.jsDepends on:
plone
Endpoints and assets π#
Content browser vocabulary:
@@getVocabulary?name=plone.app.vocabularies.CatalogStatic assets:
++plone++cs.megamenu/