Wednesday, November 17, 2010

Add dropdown menu function to WSS 3.0

Finally :) repost here:  Add dropdown menu function to WSS 3.0

To enable drop-down menu functionality, locate the following block of code in the Default.Master page (/_catalog/masterpage/default.master in the site collection or \12\Template\Global\default.master on the file system):


< asp:SiteMapDataSource
ShowStartingNode="False"
SiteMapProvider="SPNavigationProvider"
id="topSiteMap"
runat="server"
StartingNodeUrl="sid:1002" / >

If you locate this entry in web.config you will notice another entry for "SPSiteMapProvider" immediately below it. After much trial and error I discovered that this is the data source that is required for the drop-down menus. To enable it, change the SiteMapDataSource settings in default.master (or your custom master page) to the following:


ShowStartingNode="True"
SiteMapProvider="SPSiteMapProvider"
id="topSiteMap"
runat="server" />

The navigation menu will now use the SPSiteMapProvider data source which contains all the nodes in the current site collection. Depending upon your requirements, you may also wish to modify the settings for the default number of static and dynamic levels (flyouts) the navigation control displays. To do that, adjust the following settings within the < SharePoint.AspMenu / > control:

StaticDisplayLevels="2"
MaximumDynamicDisplayLevels="1"

Adjusting these values up or down will increase or decrease the number of levels. Be advised that setting the levels to a higher value may impact performance, as the control will need to fetch the relevant information from the database and build the complete menu structure before the page can finish loading.

http://sharingpoint.blogspot.com/2007/02/wss-v3-drop-down-menus-in-team-sites.html

http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/6d032478-0b6c-4308-b03f-b04e25e878fe