[[PageOutline(2-5,Contents,pullout)]] = Hierarchical navigation menus == Description With release of Trac 0.11, existing items can be [TracNavigation customized] on the main and meta navigation bars. This plugin extends that functionality to: * Add items to navigation menus. * Hierarchical organization, for example using [https://superfish.joelbirch.co/ Superfish]. The menu item '''Tickets''' on the Navigation bar has been extended with dropdown functionality: [[Image(menusplugin.png, 80%, border=2)]] '''Note''': CSS modifications might be needed to fit your Trac theme. See also: TracTabPlugin. == Bugs/Feature Requests Existing bugs and feature requests for MenusPlugin are [report:9?COMPONENT=MenusPlugin here]. If you have any issues, create a [/newticket?component=MenusPlugin new ticket]. [[TicketQuery(component=MenusPlugin&group=type,format=progress)]] == Download Download the zipped source from [export:menusplugin here]. == Source Check out MenusPlugin from [/svn/menusplugin here] using Subversion, or [source:menusplugin browse the source] with Trac. == Installation To install this plugin, follow these steps: 1. Install the plugin following the steps in the [TracPlugins#InstallingaTracplugin Trac Documentation]. 1. Eenable the plugin via !WebAdmin or add the following to your `trac.ini` file: {{{#!ini [components] tracmenus.* = enabled }}} 1. Restart the Trac server. 1. Configure as needed, see below. == Configuration As usual, configuration takes place in the `trac.ini` file. Most interesting things first - they are to be found in the `[mainnav]` section: Here you set up your menu items. Syntax is: `. = ` - where `` is either the already existing handler (e.g. "wiki" for the wiki item, "tickets" for the tickets, "newticket" for the "New Ticket" item and so on) - or a term which ''must not exist'' for a new item to be introduced (as the "Team Tools" in the [#Example Examples] section). A special case is `top` to make a new item appearing on the top level. === Defining menus in the `[mainnav]` and `[metanav]` sections The available properties and their possible values are: ||'''Property'''||'''Description'''||'''Example value'''|| ||enabled||Must be set to `1` for self defined items to be shown. Can be set to `0` to (temporarily) disable an item.||1|| ||hide_if_no_children||Don't display this (sub) menu if it has no children (e.g. the current user lacks the privileges for all sub-items)||1|| ||href||Where the item should link to||/report/1|| ||label||What should be written on the "button"||Team Tools|| ||order||Move an item to the left/right. By default, all items have an order of 999 (who will ever reach 999 items must have done something wrong, really!). Use values from 1..999 to define positions. Use a negative value for an item you want to make sure it always comes first - and a value larger than 999 if it sould always come last.||5|| ||parent||Make the item a sub-item to the one mentioned as value||top|| ||path_info||String to be matched with the request path info to decide whether a menu item should be displayed. Useful for context dependent items (e.g. in the ctxnav)||/wiki|| ||perm||For items like reports, `hide_if_disabled` does not work, since this is no component. Though, it should not be displayed if it is not available. So you can handle this by defining the required permission.||REPORT_VIEW|| === Menu options - '''inherit''': Useful when a menu should receive items from another menu: {{{#!ini # dummy example - add mainnav items to context menu. [ctxtnav] inherit= mainnav }}} === Defining behaviour in the `[menu-custom]` section Although the defaults are fine, you can customize the behavior of MenusPlugin. The syntax for the options is similar to a key-value pair: `