1

I have a custom master page and want to change the Navigation to have up to three levels as separate unnumbered lists.

So I modified the master page und using the following code:

<SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource" Id="topNavigationDelegate">
    <Template_Controls>
        <asp:SiteMapDataSource
            ShowStartingNode="False"
            SiteMapProvider="SPNavigationProvider"
            id="topSiteMap"
            runat="server"
            StartingNodeUrl="sid:1002"/>
    </Template_Controls>
</SharePoint:DelegateControl>
<asp:ContentPlaceHolder id="PlaceHolderTopNavBar" runat="server">
    <SharePoint:AspMenu
        runat="server" 
        UseSeparateCss="false"
        AdjustForShowStartingNode="False" 
        StaticDisplayLevels="2"
        AccessKey="1"
        SkipLinkText="" 
        EnableViewState="False"
        MaximumDynamicDisplayLevels="0" 
        DataSourceID="topSiteMap" 
        Orientation="Horizontal"
        RenderingMode="List"
        UseSimpleRendering="False"
        ID="TopNavigationMenu">
        </SharePoint:AspMenu>
</asp:ContentPlaceHolder>

<asp:ContentPlaceHolder id="PlaceHolderTopNavBar2" runat="server">
    <SharePoint:AspMenu
        runat="server" 
        UseSeparateCss="true"
        AdjustForShowStartingNode="false" 
        StaticDisplayLevels="1"
        AccessKey="1" 
        SkipLinkText="" 
        EnableViewState="True"
        MaximumDynamicDisplayLevels="0" 
        DataSourceID="topSiteMap2" 
        Orientation="Horizontal"
        RenderingMode="List"
        UseSimpleRendering="false" 
        ID="TopNavigationMenu2">
        </SharePoint:AspMenu>
</asp:ContentPlaceHolder>

<asp:ContentPlaceHolder id="PlaceHolderTopNavBar3" runat="server">
    <SharePoint:AspMenu
        runat="server" 
        UseSeparateCss="true"
        AdjustForShowStartingNode="false" 
        StaticDisplayLevels="1"
        AccessKey="1" 
        SkipLinkText="" 
        EnableViewState="True"
        MaximumDynamicDisplayLevels="0" 
        DataSourceID="topSiteMap3" 
        Orientation="Horizontal"
        RenderingMode="List"
        UseSimpleRendering="false" 
        ID="TopNavigationMenu3">
        </SharePoint:AspMenu>
</asp:ContentPlaceHolder>

This is working as long there are really 3 levels of pages. The problem occurs when there is no third level. In such case the 2 level is rendered twice. I have no clue why?

Can anybody give me an advice what to change please! :-)

Regards,

Christian

2

Please make change to MaximumDynamicDisplayLevels="{n}" instead of StaticDisplayLevels

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.