Saturday, April 21, 2012

SharePoint 2010 Global Navigation with the Managed Metadata Service

Recently while working with a client, a requirement for global navigation in their new SharePoint 2010 farm came up.  They have approximately 10 web applications with a minimum of 10 site collections per web application, so manually maintaining the navigation at each site collection was out of the question.  I therefore started to look at the usual suspects for global nav.  I went over the SiteMapDataSource, SharePoint 2010 Navigation Menu, and multiple other custom solutions with them.  Each one had its benefits and drawbacks but we had just about settled on a robust custom solution when an idea came to me while watching a St. Louis Cardinals baseball game (not important to the solution).  What about the Managed Metadata Service?  We were only going to have one service for the whole farm and pretty much as long as the farm is up, so is the service (i.e. not dependent on another web application).  So I started looking…

There is a label that could be used as the display name, a large text box for description that could be used for the URL and built in custom sorting and if needed could support multiple languages in the future.  Once I determined that, it was just a matter of some custom code and POC testing.

I started by setting up a Group, Term Set and the nested Terms that would make up my navigation.  Assigning each Term a “Default Label”, populating the “Description” if I want it to be a link or leaving it blank if it was just a container and unchecking “Available for Tagging” for Terms but keeping it checked for the Term Set (more on that later):