Friday, June 22, 2012

XML based SharePoint Top Navigation

Today I came across a need for multi level SharePoint top navigation, with custom navigation links and items. I started exploring the easiest way and found that I could use XML to my rescue. Here are the steps to configure it:

1) Create a XML file called TopNavigation.xml(you can call it any thing) and create the navigation items as follows:





























2) Save the xml and upload it to a document library on the site. (say a doc lib named DataSource under the root site)
3) Add the following tag to the master page


Please pay attention to the highlighted text and provide appropriate values. Parameters for the FileName and FilePath dictates where the xml file is located.

Make sure all xml and master page files are checked in and published and the site should now show the navigation as defined in the xml file.

No comments:

Post a Comment