Overview of Menu in Jahia

Basicaly a menu is a list of nodes typed as jmix:navMenuItem.

Adding a menu item, an entry, is creating a node with the type jmix:navMenuItem.

Displaying a menu is rendering all the wanted jmix:navMenuItem, depending of specified criterias.

As any other content, it is possible and easy to customize the way the node are filtered, added, and displayed.

The node type for menu is jnt:navMenu.

Its definition (in modules/default/META-INF/definitions-nav-menu.cnd) is :

  [jnt:navMenu] > jnt:content, mix:title, jmix:siteComponent
   orderable
   - j:baselineNode (string,choicelist) < 'home', 'currentPage'
   - j:maxDepth (long) = 2
   - j:startLevel (long) = 0
   - j:menuItemView (string,choicelist[templates='jmix:navMenuItem,menuItem',resourceBundle,image]) = menuElement
   - j:styleName (string) nofulltext
   - j:layoutID (string) nofulltext

The default associated JSP file is : jnt_navMenu/html/navMenu.jsp in the default module.

An entry is a mixin jmix:navMenuItem set on any type.

  [jmix:navMenuItem] mixin

The default associated JSP file is : jmix_navMenuItem/html/navMenuItem.menuElement.jsp in the default module.

We must specify a view as we want to display the mixin, not the default rendering of the node. If not specified, the menuElement view is used.

It will search for jmix:navMenuItem under the baseNode, and display items that match the set restrictions (like level or specified menu).

All these menus use the <ul><li> structure

We provide several examples of views for menus :

oneLevel : one level menu without any style other than those set by the webmaster simple : recursive menu without any styles (inpath, selected, etc) default : complete menu with styles