have been asked quite a few times if the SharePoint 2007 two tier global navigation will work with SharePoint 2010. The answer is yes with a few slight modifications. The approach stays the same: Master Page points to web.config > web.config points to .sitmap file > Page Renders custom navigation control.
The difference between 2007 and 2010 of course is that you want to add the custom site map provider to the new 2010 web.config file. Search for the following in the web.config file: “sitemap”. within the last row add the following:
<add name="DEMOGlobalNavSiteMapProvider" siteMapFile="/_layouts/1033/styles/demo/DemoGlobalNav.sitemap" type="Microsoft.SharePoint.Navigation.SPXmlContentMapProvider, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
You will notice that I placed my custom sitemap file in the style folder within the layouts directory.
There is also some slight changes to how your reference the navigation control in the 2010 master page. Here is the reference:
<!-- Start Custom Global Navigation -->
<div class="s4-lp s4-toplinks">
<asp:ContentPlaceHolder id="DemoGlobalNav" runat="server">
<SharePoint:AspMenu
ID="demoGlobalNavAspMenu"
Runat="server"
EnableViewState="false"
DataSourceID="demoGlobalNavSiteMapDataSource"
AccessKey="<%$Resources:wss,navigation_accesskey%>"
UseSimpleRendering="true"
UseSeparateCss="false"
Orientation="Horizontal"
StaticDisplayLevels="1"
MaximumDynamicDisplayLevels="3"
SkipLinkText=""
CssClass="s4-tn"/>
<SharePoint:DelegateControl runat="server" ControlId="CustomXmlContentMapProvide" Id="DemoGlobalNavDelegate">
<Template_Controls>
<asp:SiteMapDataSource
ShowStartingNode="False"
SiteMapProvider="demoGlobalNavSiteMapProvider"
id="demoGlobalNavSiteMapDataSource"
runat="server"/>
</Template_Controls>
</SharePoint:DelegateControl>
</asp:ContentPlaceHolder>
</div>
<!-- End Custom Global Navigation -->
I have placed an example of this custom two tier navigation for SharePoint 2010 in the following .zip file: Download it Here
The difference between 2007 and 2010 of course is that you want to add the custom site map provider to the new 2010 web.config file. Search for the following in the web.config file: “sitemap”. within the last row add the following:
<add name="DEMOGlobalNavSiteMapProvider" siteMapFile="/_layouts/1033/styles/demo/DemoGlobalNav.sitemap" type="Microsoft.SharePoint.Navigation.SPXmlContentMapProvider, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
You will notice that I placed my custom sitemap file in the style folder within the layouts directory.
There is also some slight changes to how your reference the navigation control in the 2010 master page. Here is the reference:
<!-- Start Custom Global Navigation -->
<div class="s4-lp s4-toplinks">
<asp:ContentPlaceHolder id="DemoGlobalNav" runat="server">
<SharePoint:AspMenu
ID="demoGlobalNavAspMenu"
Runat="server"
EnableViewState="false"
DataSourceID="demoGlobalNavSiteMapDataSource"
AccessKey="<%$Resources:wss,navigation_accesskey%>"
UseSimpleRendering="true"
UseSeparateCss="false"
Orientation="Horizontal"
StaticDisplayLevels="1"
MaximumDynamicDisplayLevels="3"
SkipLinkText=""
CssClass="s4-tn"/>
<SharePoint:DelegateControl runat="server" ControlId="CustomXmlContentMapProvide" Id="DemoGlobalNavDelegate">
<Template_Controls>
<asp:SiteMapDataSource
ShowStartingNode="False"
SiteMapProvider="demoGlobalNavSiteMapProvider"
id="demoGlobalNavSiteMapDataSource"
runat="server"/>
</Template_Controls>
</SharePoint:DelegateControl>
</asp:ContentPlaceHolder>
</div>
<!-- End Custom Global Navigation -->
I have placed an example of this custom two tier navigation for SharePoint 2010 in the following .zip file: Download it Here
Here is how it will look:
ReplyDeletePost a comment and let me know what you think. Enjoy!