Search in the Documentation:

Menu Rendering

The node type for menu is jnt:navMenu. Its definition (in modules/default/META-INF/definitions-nav-menu.cnd) looks like this:

[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 located in the jnt_navMenu/html/navMenu.jsp directory in the default module.

An entry is a mixin (jmix:navMenuItem) set on any type. Here is the mixin declaration:

[jmix:navMenuItem] mixin

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

We must specify a view (the default is menuElement) as we want to display the mixin, instead of the default rendering of the node.

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

All the menus use a standard <ul><li> structure.

Jahia provides 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