2

I have following top navigation snippet (default top navigation snippet) placed inside HTML Masterpage for SharePoint 2013.

<!--SPM:<SharePoint:AjaxDelta id="DeltaTopNavigation" BlockElement="true" CssClass="ms-displayInlineBlock" runat="server">-->
    <!--SPM:<SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource" Id="topNavigationDelegate">-->
        <!--SPM:<Template_Controls>-->
            <!--SPM:<asp:SiteMapDataSource 
                          ShowStartingNode="False"
                          SiteMapProvider="SPNavigationProvider" 
                          id="topSiteMap" 
                          runat="server"
                          StartingNodeUrl="sid:1002"/>-->
        <!--SPM:</Template_Controls>-->
     <!--SPM:</SharePoint:DelegateControl>-->
     <a name="startNavigation"></a>
     <!--SPM:<asp:ContentPlaceHolder id="PlaceHolderTopNavBar" runat="server">-->
        <!--SPM:<SharePoint:AspMenu 
                    ID="TopNavigationMenu" 
                    Runat="server" 
                    CssClass="custom-nav"
                    EnableViewState="false"
                    DataSourceID="topSiteMap"
                    AccessKey="&#60;%$Resources:wss,navigation_accesskey%&#62;"
                    UseSimpleRendering="true"
                    UseSeparateCss="false"
                    Orientation="Horizontal"
                    StaticDisplayLevels="2"
                    AdjustForShowStartingNode="true"
                    MaximumDynamicDisplayLevels="2"
                    SkipLinkText=""/>-->
            <!--PS: Start of READ-ONLY PREVIEW (do not modify)--><link rel="stylesheet" type="text/css" href="http://sp2013-srv25:1515/_layouts/15/1033/styles/menu-21.css" /><div id="zz7_TopNavigationMenu" class=" noindex ms-core-listMenu-horizontalBox"><ul id="zz9_RootAspMenu" class="root ms-core-listMenu-root static"><li class="static"><a class="static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode" tabindex="0" title="Default Publishing Site" href="#" accesskey="1"><span class="additional-background ms-navedit-flyoutArrow"><span class="menu-item-text">Default Publishing Site</span></span></a></li></ul></div><!--PE: End of READ-ONLY PREVIEW-->
      <!--SPM:</asp:ContentPlaceHolder>-->
<!--SPM:</SharePoint:AjaxDelta>-->

Above snippet is the default top navigation snippet, I have only updated CssClass property with my own CSS class custom-nav.

This masterpage is applied for Site Master Page and also System Master Page.

So now my question is when I view the every pages except Settings.aspx, this navigation is having my custom class of navigation custom-nav.

But when I open /_layouts/15/settings.aspx page, at that time my custom class is not being applied, instead s4-tn class is being applied. Anybody know why so?

Also I have noticed that Search control snippet is being hidden in the DOM only for this settings.aspx page. Does anyone have idea about this behavior?

3

reference

  1. Search for ID="PlaceHolderTopNavbar"

  2. Bring the Sharepoint:AspMenu control outside of this placeholder and delete asp:ContentPlaceHolder tag

enter image description here

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.