mod_menu

Create nested navigation menus for your site.

Activating the module in the admin enables a “menu” item in the admin navigation under “content”, which lets you define a simple menu. Every item in the menu references a Zotonic page and can be looked up using the autocompletion widget.

This menu can be rendered in the frontend with the menu custom tag.

It will use the _menu.tpl template which is by default able to render a Twitter Bootstrap compatible menu structure using nested <ul> elements.

To implement a different navigation menu, override the _menu.tpl in your project and create new markup.

Domain model

The domain model for this module is the following:

The module creates a new category named menu. This allows one to create multiple menus in a single site. Its edit page in the admin contains the hierarchical menu editor.

The menu resource that is accessible from the admin page (Content > Menu) is the resource with the unique name main_menu.

Edit on GitHub

Dispatch rules

dispatch

Dispatch rules Name Path Resource Args admin_menu_hierarchy [“admin”,”hierarchy”,name] controller_admin [{template

Filters

menu_expand

Takes a menu, or a menu resource id, and adds all haspart objects connected to the menu ids.

menu_flat

Flattens the rsc menu structure for use in a template loop.

menu_ids

Returns all resource ids in a menu. Could return invisible and non existing resource ids. The returned ids are a flat…

menu_is_visible

Filters a list of menu items on visibility and existance. Only top-level menu items that are both visible and exist are…

menu_rsc

Return the menu to be displayed with a resource.

menu_subtree

Get the subtree of an id in a menu (if any).

menu_trail

Return a breadcrumb navigation trail for the given id.

Scomp

menu

Show a page menu.

See also

menu_flat

Flattens the rsc menu structure for use in a template loop.

menu_subtree

Get the subtree of an id in a menu (if any).

menu_trail

Return a breadcrumb navigation trail for the given id.

mod_admin_category

Add support for editing Categories in the admin, by presenting an editable category tree at http://yoursite.com/admin…

Referred by

Site configuration

This chapter describes the configuration options for your sites. There’s also global configuration.

All dispatch rules

All the dispatch rules from all modules. For a background on dispatch rules, see The URL dispatch system.