user592501
user592501

Reputation:

SharePoint 2010: Quick Launch Navigation Levels

Can someone tell me how to configure the OOTB AspMenu control to achieve the following:

Essentially, the navigation menu should appear as follows (assume that the subsites both have child sites and/or pages but which should be hidden):

Starting Node 
- Subsite1
- Subsite2
- Page1  
- Heading
  - Page2
  - Page3

Upvotes: 0

Views: 1359

Answers (1)

user592501
user592501

Reputation:

I couldn't find a way to achieve this functionality using the properties of the AspMenu control, so instead I just explicitly removed and subsite's child items in the MenuItemDataBoundEvent as follows:

protected void CurrentNavigationMenu_MenuItemDataBound(object sender, MenuEventArgs e)
{
    // Hide the contents of subsites (only level-1 links beneath headings are displayed).
    if (e.Item.Parent != null && e.Item.Parent.Selectable)
        e.Item.Parent.ChildItems.Remove(e.Item);
}

Upvotes: 0

Related Questions