Partager via


Using Managed Metadata With Variations in SharePoint 2013

I was working with some folks who were having troubles getting metadata driven navigation working with variations recently and it turned out that there were a few details important to know in order to get this to work so I thought I would share them here. The basic gist of the problem is this – you want to use variations for all of the well-known goodness it provides: automatically creating different locale subsites, automatically copying pages and lists from a source site to all of the target sites, etc. In addition to that though you want to use the Managed Metadata Service to provide metadata driven navigation, so you can have friendly URLs in the site and a navigation scheme that is centrally-managed. You can definitely do this, but there are some important steps to remember.

The first and most important thing to understand is that variations will not copy a term set term to a target site unless there is a page associated with it! So if you just go in and create a term set and then expect all of those terms to be copied to target sites, you’ll be disappointed. Variations is really designed to copy sites, lists and pages, so you need to use those same sort of constructs to get MMS terms to get copied along as well. Once you have associated terms with pages in the source site collection, running the Variations Propagate Page Job Definition job for the web application in which your variations site collection exists will take care of creating the term reuse and copying the pages over.

The next important thing to remember is that you need to always use and work with a term set within the site collection where you are using variations. For example, if open the term set tool from the Manage Services page in central admin and then use the MMS tool to Translate the term, you will likely see an error that reads something like this site has not been shared with you. However if you open the tool from within the site collection where the variations are located you should not see this issue.

Finally, this is “like” a one-time copy operation. What that means is that if you change attributes about the term, you move them into a different place in a term hierarchy, etc. – that won’t get picked up by the variations timer jobs. So if you do makes changes with the terms themselves after they’ve been pushed out to the target sites you will likely need to do some manual updating, write scripts for the updates, etc.

This still allows you to use friendly URLs in your site; you just need to associate them with pages. So as an example, suppose I have a term set that contains a term called Northwinds and I want that to show up as navigation in all my target sites. Here’s the process I would go through (all done from the source variations site):

  1. Go to the Pages library and create a new page. In this case I will call it Northwinds. You can use whatever page template you want, just create the page and add content.
  2. Click on the page in the Pages library so you can go edit it.
  3. Click on the Page tab in the ribbon, then click on the Page URLs button: 
  1. Click the link to “Add a friendly URL to this page”, and then select the term you want this page to be associated with.

 

 

You can decide whether to associate it with just this term or this term and all child terms or all sibling terms.

  1. Click the Add button.
  2. Click the Finish button.
  3. Publish your page.
  4. Run the Variations Propagate Page Job Definition (it runs every 15 minutes by default but you can run it manually if you don’t want to wait).

That’s all there is too it. Here’s a before and after example:

BEFORE:

AFTER:

Comments

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    thanks for sharing.

  • Anonymous
    January 01, 2003
    Well done

  • Anonymous
    September 18, 2014
    The comment has been removed

  • Anonymous
    February 24, 2015
    Great article ...Thanks for your great information, the contents are quiet interesting. I will be waiting for your next post.
    http://staygreenacademy.com">SharePoint 2013 Developer training Online

  • Anonymous
    February 24, 2015
    Wooh this is very informative article. Thank you so much..!
    http://khalil-kothia.com">SharePoint Consultant