in

vbCity Blogs

New (temp) place for vbCity Blogs

Andy Bonner's Blog

My SharePoint titbits and other things that take my fancy.

2 Level Top Navigation

 This is not my own work but something I picked up from a post a came across on MSDN that I thought would be useful, so i thought I'd blog it here so i knew where to find it in the future. Big Smile.

Credit for this goes to Elizabeth Elizondo.

All you need to do is add this after the PlaceHolderTopNavBar ContentPlaceHolder then tweak it to your requirements.

<asp:ContentPlaceHolder ID="Sublinks" runat="server">
  <SharePoint:AspMenu
      ID="subMenu"
      Runat="server"
      DataSourceID="subSiteMap"
      EnableViewState="false"
      AccessKey="<%$Resources:wss,navigation_accesskey%>"
      Orientation="Horizontal"
        StaticDisplayLevels="1"
        StaticItemFormatString="{0}"
        SkipLinkText=""
        StaticSubMenuIndent="0"
        MaximumDynamicDisplayLevels="0"
        CssClass="ms-topNavContainer">
       <StaticMenuItemStyle CssClass="ms-topnav" ItemSpacing="0px"/>
       <StaticSelectedStyle CssClass="ms-topnavselected" />
       <StaticHoverStyle CssClass="ms-topNavHover" />
      </SharePoint:AspMenu>


      <asp:SiteMapDataSource
        SiteMapProvider="CombinedNavSiteMapProvider"
        ShowStartingNode="false"
        StartFromCurrentNode="false"
        StartingNodeOffset="1"        
        id="subSiteMap"
        runat="server"/>
 </asp:ContentPlaceHolder>

Then you'l l end up with something like this

 2 Level Menu

Only published comments... Dec 07 2008, 08:15 PM by Andy Bonner
Filed under: , ,

About Andy Bonner

 

Copyright 1998-2009 vbCity.com LLC
Powered by Community Server (Non-Commercial Edition), by Telligent Systems