locked
Hiding home site tab on top navigation bar RRS feed

  • Question

  • I would like to hide the home tab on my top navigation bar.  I was told that I needed to add the attribute 'ShowStartingNode = "False"' in my topnavbar ASPmenu control.  I checked and it is already there.  Does anyone know why it is not recognizing this attribute? I do not have any custom features that would affect this.

     

    <SharePointBig SmileelegateControl runat="server" ControlId="TopNavigationDataSource">
      <Template_Controls>
       <aspTongue TiediteMapDataSource
         ShowStartingNode="False"
         SiteMapProvider="SPNavigationProvider"
         id="topSiteMap"
         runat="server"
         StartingNodeUrl="sid:1002"/>
      </Template_Controls>
     </SharePointBig SmileelegateControl>

     

     

    Monday, April 7, 2008 9:33 PM

Answers

  • Just Replace this:

     

    Code Snippet


      

    <SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource">
      <Template_Controls>
       <asp:SiteMapDataSource
         ShowStartingNode="False"
         SiteMapProvider="SPNavigationProvider"
         id="topSiteMap"
         runat="server"
         StartingNodeUrl="sid:1002"/>
      </Template_Controls>
     </SharePoint:DelegateControl>  
     


     

     

     

    with this:

     

    Code Snippet

    <asp:SiteMapDataSource
         ShowStartingNode="False"
         SiteMapProvider="CombinedNavSiteMapProvider"
         id="topSiteMap"
         runat="server"/>

     

     

    And it should work for you.  You may need to adjust the StaticDisplayLevels and MaximumDynamicDisplayLevels on your SharePoint:AspMenu to get it to show the right elements for you.
    Tuesday, May 20, 2008 10:21 PM

All replies

  • Just Replace this:

     

    Code Snippet


      

    <SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource">
      <Template_Controls>
       <asp:SiteMapDataSource
         ShowStartingNode="False"
         SiteMapProvider="SPNavigationProvider"
         id="topSiteMap"
         runat="server"
         StartingNodeUrl="sid:1002"/>
      </Template_Controls>
     </SharePoint:DelegateControl>  
     


     

     

     

    with this:

     

    Code Snippet

    <asp:SiteMapDataSource
         ShowStartingNode="False"
         SiteMapProvider="CombinedNavSiteMapProvider"
         id="topSiteMap"
         runat="server"/>

     

     

    And it should work for you.  You may need to adjust the StaticDisplayLevels and MaximumDynamicDisplayLevels on your SharePoint:AspMenu to get it to show the right elements for you.
    Tuesday, May 20, 2008 10:21 PM
  • Hello,

     

    Thanks for the tip. Solved a long time problem.

     

    Regards,


    André

    Monday, June 2, 2008 10:19 AM
  • This fixes only the top navigation bar. The breadcrumbs (SiteMapPath) still displays the hidden root site, even if I change its SiteMapProvider. Does anybody know how to solve this?

     

    What I basically want is to hide the root site from all navigation controls. I use the root site as a container for site collection level elements (lists, content types etc.), but I don't want users to visit it.

    • Proposed as answer by ReviewItGuy Thursday, November 20, 2008 5:45 PM
    • Unproposed as answer by Mike Walsh FIN Friday, February 6, 2009 6:27 AM
    Monday, June 9, 2008 1:35 PM
  • This is a complete hack, but it works.  The hack requires JQuery. 

    $(document).ready(function(){         
        var rootNode = $("span[id$=siteMapPath] > span:eq(0)");
       
        if (rootNode.attr("class") == "breadcrumbCurrent")
        {
            rootNode.hide();
        }
        else
        {
            rootNode.show();
        }
    });
    Thursday, November 20, 2008 5:48 PM
  • I have the same question as the original poster and have changed the above in the master page, but it is still not working.
    Master page top nav section looks like:

    <SharePoint:AspMenu
    	  ID="TopNavigationMenu"
    	  Runat="server"
    	  DataSourceID="topSiteMap"
    	  EnableViewState="false"
    	  AccessKey="<%$Resources:wss,navigation_accesskey%>"
    	  Orientation="Horizontal"
    	  StaticDisplayLevels="2"
    	  MaximumDynamicDisplayLevels="1"
    	  DynamicHorizontalOffset="0"
    	  StaticPopoutImageUrl="/_layouts/images/menudark.gif"
    	  StaticPopoutImageTextFormatString=""
    	  DynamicHoverStyle-BackColor="#CBE3F0"
    	  SkipLinkText=""
    	  StaticSubMenuIndent="0"
    	  CssClass="ms-topNavContainer">
    		<StaticMenuStyle/>
    		<StaticMenuItemStyle CssClass="ms-topnav" ItemSpacing="0px"/>
    		<StaticSelectedStyle CssClass="ms-topnavselected" />
    		<StaticHoverStyle CssClass="ms-topNavHover" />
    		<DynamicMenuStyle  BackColor="#F2F3F4" BorderColor="#A7B4CE" BorderWidth="1px"/>
    		<DynamicMenuItemStyle CssClass="ms-topNavFlyOuts"/>
    		<DynamicHoverStyle CssClass="ms-topNavFlyOutsHover"/>
    		<DynamicSelectedStyle CssClass="ms-topNavFlyOutsSelected"/>
    	</SharePoint:AspMenu>
    	<SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource">
    		<Template_Controls>
    			<asp:SiteMapDataSource
    			  ShowStartingNode="False"
    			  SiteMapProvider="CombinedNavSiteMapProvider"
    			  id="topSiteMap"
    			  runat="server"/>
    		</Template_Controls>
    	</SharePoint:DelegateControl>
    But the top navigation bar still has: 

    Root Site > Sub Site > Sub Site

    How do I hide the root site, any ideas?

    Thanks,
    Matt
    Wednesday, January 20, 2010 10:38 PM