HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket


The building blocks of the navigation are menu providers and menu items. A menu provider provides an enumeration of menu items which are organized in a tree according to their menu path. Optimizely Content Management System (CMS) contains a menu provider that looks at `[MenuItem] `attributes and provides them as menu items.

### IMenuProvider

You can extend the standard menu by implementing a menu provider as an alternative to attributes. The menu provider returns menu items that are correctly localized. To use a menu provider, implement the `IMenuProvider` interface, decorate it with the `[MenuProvider]` attribute, and make it part of a registered shell module.

### Add menu items

You can add menu sections and sub-menu items such as menu sections, drop-downs, URLs and pop-up menu items. Each menu item defines a path which determines its location in the menu hierarchy. For example, a URL menu item with path /global/cms/myMenu is placed in the CMS section of the menu (which has the path /global/cms).

Types:

  • **URL Menu Item** are links; a click navigates to specified URL.

  • **Popup Menu Item [Obsolete]** are links that are opened in a new tab.

  • **Section Menu Item** are global menu sections which change the visible menu items.

  • **Drop-Down Menu** ** Item** are drop-down style menu items designed for the action item area (right-hand side).

Example:



### Localize menu items with a menu provider

A menu provider returns localized menu items.

### Permissions with the menu provider

A menu provider can specify `AuthorizationPolicy` for each menu item, that controls which policy that must apply for the menu item to be available. Another alternative is to defer permission filtering to the menu item by setting the `IsAvailable` delegate to a method that checks access for the user provided with the `HttpContext` parameter.

### Flow of menu items

Menu items flow from the providers into a hierarchical model, which is rendered into HTML.



### Configure NavigationOptions

The menu can also be extended by configuring `NavigationOptions` either through code or through _appSettings.json_ as follows: