Making SharePoint 2010 Foundation top menu using submenu popups

By default SharePoint 2010 Foundation menus are not hierarchical and we have to move from site to site using top menus or quick launch menus. In this posting I will show you how to make SharePoint 2010 Foundation top menu hierarchical so it shows submenus when user moves over menu items with mouse.

Open v4.master and find the following menu definition:


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

Perform the following steps:

  • for AspMenu (with ID “TopNavigationMenuV4”) set the value of MaximumDynamicDisplayLevels to something that is greater than one (by example: 4 or 5),
  • for sitemap data source (ID is “topSiteMap”) set the value of ShowStartingNode attribute to True.

Save your master page and refresh page. Your top menu uses now dynamic submenus.


Leave a Reply

Your email address will not be published. Required fields are marked *