开发者

SharePoint 2010: Quick Launch Navigation Levels

开发者 https://www.devze.com 2023-02-18 10:40 出处:网络
Can someone tell me how to configure the OOTB AspMenu control to achieve the following: The quick launch should only show 1 level of static items

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

  • The quick launch should only show 1 level of static items
  • Except for headings, these are meaningless on their own so the pages/links beneath them should also be displayed
  • The menu should not display an dynamic flyouts

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

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


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);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号