Hide First Tab in SharePoint 2010 Navigation

 In SharePoint 2010 when you create new site or sub-sites it will show Home in first tab. this post will show how to hide first tab.


Here is the original code of top navigation control:
<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>


And then make the following changes to the static, dynamic and site map provider:
<SharePoint:AspMenu    
  ID="TopNavigationMenuV4"    
  Runat="server"    
  EnableViewState="false"    
  DataSourceID="topSiteMap"    
  AccessKey="<%$Resources:wss,navigation_accesskey%>"    
  UseSimpleRendering="true"    
  UseSeparateCss="false"    
  Orientation="Horizontal"    
  StaticDisplayLevels="1"    
  MaximumDynamicDisplayLevels="2"    
  SkipLinkText=""    
  CssClass="s4-tn"/>    
        <asp:SiteMapDataSource    
          ShowStartingNode="False"    
          SiteMapProvider="CombinedNavSiteMapProvider"    
          id="topSiteMap"    
          runat="server"/>

Comments

Popular posts from this blog

PHP: Date Difference for PHP 5.2

HTML5 video loop src change on end play function

Custom OpenCart 2.3.0.2 theme