Skip to content

Hide SharePoint Root Level site tab under global navigation:

February 7, 2019

Below is the change(which is in blue color) I made to the master page so it would hide the root level tab from global navigation.

Change this:

<SharePoint:AspMenu

ID=”TopNavigationMenuV4″

Runat=”server”

EnableViewState=”false”

DataSourceID=”topSiteMap”

AccessKey=”<%$Resources:wss,navigation_accesskey%>”

UseSimpleRendering=”true”

UseSeparateCss=”false”

Orientation=”Horizontal”

StaticDisplayLevels=”2″

MaximumDynamicDisplayLevels=”1″

SkipLinkText=””

CssClass=”s4-tn”/>

<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>

 

To this:

<SharePoint:AspMenu

ID=”TopNavigationMenuV4″

Runat=”server”

EnableViewState=”false”

DataSourceID=”topSiteMap”

AccessKey=”<%$Resources:wss,navigation_accesskey%>”

UseSimpleRendering=”true”

UseSeparateCss=”false”

Orientation=”Horizontal”

StaticDisplayLevels=”1″

MaximumDynamicDisplayLevels=”0″

SkipLinkText=””

CssClass=”s4-tn”/>

<asp:SiteMapDataSource id=”topSiteMap”
ShowStartingNode=”False”
SiteMapProvider=”CurrentNavSiteMapProvider”
runat=”server”/>

Advertisement

From → General, Master Pages

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: