3

I'm working on a SP 2013 branding project, and I'm running into an issue getting uniformity. The Site Settings page is rendering differently than the rest of the site. I'm working on the top navigation and I have it rendering as a table on the majority of the site by setting the AspMenu.UseSimpleRendering property to false in my custom master, but on the Site Settings page the top nav is still rendering as an unordered list. I have to render this as a table because I need the text to wrap, and with the top nav as an unordered list it is expanding the width of the page and creating horizontal scroll.

Why is this control not rendering consistently?

I know SP 2010 had the application.master. Is this a similar issue here?

Edit:

I ended up working around this by using the simple rendering and using the CSS display:table; and display:table-cell properties to achieve what I needed. I also set the CssClass property of the AspMenu control to s4-tn in my custom master in order to use this class for consistency of the menu. The Site Settings page is rendering a different top nav control with the s4-tn class by default, so by adding this same class into the custom master page we end up with consistent markup on both content and settings pages.

The question remains though, why does this render a different control, and how can you change this rendering on the site settings page?

Edit 2:

Yes, I have set my custom master page to SPWeb.MasterUrl and to SPWeb.CustomMasterUrl.

  • I am facing the same problem but adding s4-tn class and changing display to table is not helping. May be I am doing at wrong place, do you mind shareing your code and css. That might be a big help. -Meghna – user36931 Dec 11 '14 at 15:30
3

OK, so I figured out the root cause of this.

In the 15 hive, the settings.aspx file has the top navigation defined as:

<%@ Register TagPrefix="wssuc" TagName="TopNavBar" src="~/_controltemplates/15/TopNavBar.ascx" %>
<asp:Content contentplaceholderid="PlaceHolderTopNavBar" runat="server">
  <wssuc:TopNavBar id="IdTopNavBar" runat="server" Version="4" ShouldUseExtra="true"/>
</asp:Content>

In the file ~/_controltemplates/15/TopNavBar.ascx, the control has the code:

<% ...
    if (m_bShouldUseExtra == true ) { %>
        <SharePoint:AspMenu
            ID="TopNavigationMenuV4"
            Runat="server"
            EnableViewState="false"
            DataSourceID="topSiteMap"
            AccessKey="<%$Resources:wss,navigation_accesskey%>"
            UseSimpleRendering="true"
            UseSeparateCss="false"
            Orientation="Horizontal"
            StaticDisplayLevels="2"
            AdjustForShowStartingNode="true"
            MaximumDynamicDisplayLevels="1"
            SkipLinkText=""
            CssClass="s4-tn" />
<% } ... %>

Thus explains the top nav bar rendering as it was in SP2010, and why the root container has the s4-tn CSS class.

Long story short, to keep the markup consistent you can add the "s4-tn" class to the <SharePoint:AspMenu/> control in your master page and use this as the basis of your CSS selectors.

1

Don't disable simple rendering for this, use CSS:

http://jsfiddle.net/yijiang/z8Gfe/

That is, use float: left rather than display: inline on your li tags, should cause wrapping rather than a scrolling overflow.

0

Do you have your masterpage set as the custom master page as well as the default masterpage? Open you page in designer and when you select it you can see if its set as both in the ribbon.

If your masterpage is not set for both then it will only be applied once.

  • If you're referring to setting SPWeb.CustomMasterUrl as well as SPWeb.MasterUrl, yes I have the master page set as both of these. – RJ Cuthbertson Oct 27 '13 at 6:46
0

This article works great

The answer is to remove "PlaceHolderTopNavbar" .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.