Thursday 17 November 2016

3rd Level SharePoint SharePoint Navigation in Global Navigation

SharePoint 2013 only supports one level deep on drop downs. If you require the navigation to show 2nd level or 3rd level item under the 2nd level, global navigation will not allow it directly. The other approaches are you do managed navigation. But it has its own limitations listed here.

Resolution:

If you require the navigation to show 2nd level menu, you need to make a very minor tweak to the master page that the site is using.

  1. Using SharePoint Designer (SPD), open the master page being used by the site. In SPD, navigate to _catalogs/masterpage/yourmasterpage.html
  2.  In the master page file, search for SharePoint:AspMenu.
    1. You will more than likely have more than one instance of a menu control.  Look at the IDs to find the right navigation control for what you want to edit.  They are intelligently named, you will be able to sort out which one you need.   For default.master, look for ID=”TopNavigationMenu”.
  3. In the properties for the tag, find MaximumDynamicDisplayLevels=”1″.  Change the number from 1 to 2. (You need to level till you need navigation)
  4. Save the file and publish the master page (do this from SPD, Manage Content and Structure, or the Master Page Gallery).
  5. Refresh your browser.  Now when you mouse over menu, you should see another level of navigation pop up.
  6. If you have more than 2nd level of navigation, you have to first add them separately in global navigation first. Once you save your changes, edit top navigation, drag 2nd level navigation under 1st level navigation.
  7. If you have more than 2 level navigation, you won't be able to drag 3rd level navigation in 2nd level. For that you need to create your custom master page and do that process.

Limitations of Managed Navigation in SharePoint 2013

When SharePoint 2013 came out, one of the most promising features was the Managed Navigation. Configuring Managed Navigation in SharePoint 2013 is straightforward and provides great no-code solution. In this blog, I will walk through some of the major limitations and why you must avoid this solution.
 
1) For each site collection you need separate Term Set.
It is important to note that each term set can be associated with only one site collection at given time. In other words, it requires dedicated copy of term set for each site collection navigation. E.g. If you have 5 site collections, you must have 5 copies of same term set to use for 5 site collections navigation data.

If term set is already configured to use for Site Collection navigation and if you try to reuse same term set in another site collection, SharePoint will throw following warning “The selected term set is already used by another site” 

2) Managed Navigation can’t be secured or targeted to specific group.
 One of the great abilities of Structured Navigation was you can configure audience targeting or secure each menu item for specific audiences or SharePoint security groups. Unfortunately Managed Navigation can’t be secured or targeted to specific security group.

3) Manual Maintenance is still required to update global navigation menu items.
 As we discussed earlier, you must have 1 term set for each site collection. If you have more than 1 site collection, you must have more than 1 term set dedicated to each site collection. To ensure, all the site collection uses same navigation menu items, there are two options available in SharePoint 2013 for replicating term sets. Regardless of which approach you may take, it will require manual maintenance of reconfiguring term sets when you have changes in term set.

4) Managed Navigation doesn’t apply to Sub Sites automatically.
 This is another one of those mind-boggling limitations of Managed Navigation. If you have enabled Managed Navigation at the site collection and while creating sub sites, if you are planning to inherit parent navigation, Managed Navigation doesn’t apply to sub sites automatically. To resolve this peculiar issue, you must open Navigation page from sub site settings page and click “OK” for to take in effect.
   
5) Managed Navigation doesn’t provide open link in new tab.
Structural navigation provide you check box option to open link in new tab. This functionality is not provided in Managed navigation. Though you can overcome this issue with JavaScript patch, you need to put this patch in master page of each site collection to work.

6) Managed Navigation conflict with SharePoint js.
Managed navigation stops working if you explicitly load sp.core.js in your page. The sub level navigation stops populating. I don’t know the strange behavior of it as sp.core.js is SharePoint own js file. 

7) Managed Navigation displays additional home tab. 
This is not though limitation but its annoying for sure. Managed navigation displays first tab with site name additionally. You can't directly change it or hide it. The thing we need to do with it is mostly hide it with javascript and the bad thing is we need to put that in each and every masterpage.