Display the home link in top navigation menu in SharePoint 2010

On my SharePoint 2010 site, I needed to display a home link in the top navigation menu. One way of doing it is to add a heading called “Home” in the navigation list(Site Actions->Site Settings->Look and Feel->Navigation->Navigation Editing and Sorting). After adding this, all the back end pages have a top navigation menu with two Home links. So  I needed to do it in a way that works for both front end and back end.

1. Open the master page in SharePoint Designer 2010.

2. Search for “topSiteMap”. 5 lines after that, change the value of StaticDisplayLevels to 2.  3 lines after that, you should see a tag called asp:SiteMapDataSource. Change the value of ShowStartingNode to True.

Here is all the code for the navigation menu in the master page:

<div id=”s4-topheader2″ style=”border:0;background:transparent;”>
<a name=”startNavigation”></a>
<asp:ContentPlaceHolder id=”PlaceHolderTopNavBar” runat=”server”>
<asp:ContentPlaceHolder id=”PlaceHolderHorizontalNav” runat=”server”>
<SharePoint:AspMenu
ID=”TopNavigationMenuV4″
Runat=”server”
EnableViewState=”false”
DataSourceID=”topSiteMap”
AccessKey=”<%$Resources:wss,navigation_accesskey%>”
UseSimpleRendering=”true”
UseSeparateCss=”false”
Orientation=”Horizontal”
StaticDisplayLevels=”2″
MaximumDynamicDisplayLevels=”3″
SkipLinkText=””
CssClass=”s4-tn noindex”/>
<asp:SiteMapDataSource ShowStartingNode=”True” SiteMapProvider=”CombinedNavSiteMapProvider” id=”topSiteMap” runat=”server”/>
</asp:ContentPlaceHolder>
</asp:ContentPlaceHolder>
</div>

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s