Interview Questions administrator

Best SharePoint administrator Interview Questions and Answers with topic wise:


Recycle Bin | MMS | ManagedVsCrawledProperties |

Thursday, March 8, 2012

Custom GlobalNavigation in SharePoint



It’s a very common requirement to apply nested nodes to the top level global navigations for most of the SharePoint developers. But, by default SharePoint limits up to one level only. Don’t worry I have done it. You can implement the nested nodes to the top navigation by following the below steps.

Step1: Create a sitemap file and place that file in “app_bin” folder.

Note:
·         <siteMapNode title="Home" url="/site/subsite/default.aspx" target="_new" />
·         To customize menu items to new popup window as target than default “_top” window.
Step2: Configure the sitemap file reference in the “web.config” file like below
            <add name="CustomXmlContentMapProvider” siteMapFile="_app_bin/mainMenu.sitemap" type="Microsoft.SharePoint.Navigation.SPXmlContentMapProvider, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />

Note:  You can use any SiteMapProvider, but the easiest answer is to use the Microsoft.SharePoint.Navigation.SPXmlContentMapProvider.

Step 3: Now change in your master page.
Modify the master page; add the following inside a SharePoint: DelegateControl, preferably right next to topSiteMap declaration.
<asp: SiteMapDataSource
ShowStartingNode="true"
SiteMapProvider="CustomXmlContentMapProvider"
id="xmlSiteMap"
runat="server"
/> 


Modify the master page, and change the SharePoint: AspMenu, with ID=TopNavigationMenu, change its DataSourceID from "topSiteMap" to "xmlSiteMap".

Step 4: Refresh your site; you will get the below exception if you don’t have limited permissions on your site map file.


 Check for the solution <a href=””>here</a> with clear explanation about when/why the exception raised.

My Next the post on: Implement custom top level globalization with impersonation.

I am sharing all you guys after experimenting this. Please inform me if you face any problems.

No comments:

Post a Comment