Menu

Current version: 9.0

The Menu control shows a menu for an application. You use it in page structures that include a navigation pane, for example ApplicationContentNM and ApplicationContentNMI. These page structures have a placeholder called Navigation and this is where you must put the Menu control.

To populate the menu with links to items, specify the Sitecore ID of the root item of the items that you want in the menu. The Menu control can populate the menu in two different ways:

  • You point to a SPEAK page as the root of the menu.

    The Menu control creates a menu that corresponds to the structure of items under this root item in the content tree. It shows the immediate children of the root item as top-level collapsible sections in the menu. For the root item itself and the immediate children, the Menu control shows the icon of the item, if it has an icon. You can specify that the Menu control does not show the root item. The control creates links to all subsequent child items, except for PageSettings items and items under these items.

  • You construct a tree of HyperlinkButton Parameter items, and point to the root of this tree.

    You specify the destination of links in the NavigationUrl field of each HyperlinkButton Parameter item. You can use the Click field of the HyperlinkButton Parameter items to create links that respond to JavaScript, and you can use the Target fields to specify that links open in a new window. Finally, you can add queries to the URLs when you use HyperlinkButton Parameter items.

Note

If you enter a URL with a query, the Menu control might not be able to resolve what link it is, and therefore cannot highlight the link in the menu. You can help the control to find the correct link by adding the ID of the item to the URL, for example: somewhere.com/my_page?value=5&menuItemId={123-346-47554763346}

The Menu control has two properties that you use to specify the initial state of the menu:

  • DefaultSelectedItemId: specify the link that the Menu control selects and highlights the first time the user opens the page with the menu.

  • ExpandedItemIds: specify top-level collapsible sections that the Menu control expands the first time the user opens the page with the menu. You can enter multiple sections as a comma-separated list.

Once a user has visited the page, the Menu control remembers the state of the collapsible sections and the selection.

Do you have some feedback for us?

If you have suggestions for improving this article,