Stefan Goßner

Senior Escalation Engineer for SharePoint (WSS, SPS, MOSS, SP2010) and MCMS

SharePoint Variations – The complete Guide – Part 7 – Variation Hierarchy Creation

SharePoint Variations – The complete Guide – Part 7 – Variation Hierarchy Creation

  • Comments 4
  • Likes

Overview

In order to create the hierarchies you first need to configure the variation labels, which should be spawned. At least the source Variation Label has to be configured in order to create the hierarchies.

Important: The creation of the hierarchies will fail if a site exists inside the Variation root site with the same name as one of the variation labels, which is about to be spawned.

 

The Create Hierarchies button in the UI will create a Scheduled Work Item in the Content Database of the site collection which is later retrieved by the CreateVariationHierarchiesJobDefinition timer job to do the actual creation of the hierarchy.

 

Per default, the timer job is configured to run once a day between 12 AM and 3 AM - that means a user will usually have to wait until the next day for the hierarchy creation to happen.

Alternatively, a farm administrator can run the job manually at any given time from the central admin site.

 

What happens during Timer Job execution?

Source variation and target variation top sites are always created one level below the variation root site. Each variation top site is using the site template configured when defining the source variation label.

To change the look and feel between the different top sites you can either use a different theme and/or a different master page.

When the variations hierarchy is first created, only the variation top sites are created. Afterwards you can create the sub sites in the variation source hierarchy. Variants of these sites are then created in the target labels - either automatically or manually.

If sites or pages are created directly in a target label, they will not be part of the variation hierarchy and content in these sites and pages will be independent from other labels.

If a new label is added to the variation hierarchy after the variations hierarchy of the source label has been first created, a new top variation site is created for the new label and in addition, (default setting) pages and sites in the source label are automatically variated to the new label.

Creating the variation hierarchy involved three major steps:

  1. Create the VariationRoot.aspx landing page which contains the logic to redirect to the different label and configure this page as welcome page for the Variation Root site
  1. Create the Variation Top site for the source variation label underneath the Variation Root site
  2. Replicate the site structure and the publishing pages from the Source Variation label to new configured target and not yet spawned variation labels

Here are more details about the three steps:

 

Configuring the Variation landing page

The Timer Job first verifies if a page with name VariationRoot.aspx exists in the Pages library of the Variation root site.

If this is not the case, it will create, check-in, publish and approve a new Publishing Page at this location based on the VariationRootPageLayout.aspx page layout, which is part of the SharePoint Server Publishing Infrastructure feature.

The last step is to configure the VariationRoot.aspx page as welcome page for the variation root site.

 

Creating the Variation Top site for the source variation label

The Timer Job first verifies if the top site of the source label already exists and will skip the rest of the steps if yes.

After checking that the top site does not exist, it will disable the automatic spawning of new created sites to the target labels to ensure that the Timer Job responsible to perform the site spawning does not pick up the new site while the hierarchy is not fully created.

The next step is to provision a new publishing site based on site template, locale and language configured in the variation settings. The title of the site will be the configured display name of the variation label.

The new site will then be marked as being a member of the variation hierarchy and a new entry for the site is created in the global Relationships List.

Afterwards the new site is configured as variation top site of the label and the hierarchy of the label will be marked as created.

The final step is to re-enable the automatic spawning of new created sites to the target labels.

 

Replicating content from source to target labels

This is the most complex step as it is possible to add new labels long after the source hierarchy is created and new sites and pages have been added to the source label it is not sufficient to just replicate the variation top site to the target labels.

Depending on the variation settings, it might be necessary to replicate the following information:

  • Just the top level sites
  • The whole site structure without pages
  • The whole site structure including all pages

The default is to replicate the whole site structure including all pages.

Here is the high-level description of how the replication is done by the timer job. Be aware that some of these operations are also performed in the other timer jobs, which are responsible to replicate only sites or pages:

For each unspawned target label, we perform the following steps:

  1. Provision the top site in the target label using the same template as on the source label using the Display Name, locale and language configured for the target label
  2. Ensure that the new site has the same configuration (variation group id, welcome page, features, navigation, UIVersion, Master page, Theme…) as the peer site in the source label
  3. The new site will then be marked as being a member of the variation hierarchy and a new entry for the site is created in the global Relationships List
  4. Pair up the pages created while provisioning the site with the equivalent items in the source site by assigning the same variation group ID to both and copy the page content from source to target label using the content deployment and migration API
  5. Recursively provision all sites that exist below the variation top site in the source label to the target label and copy all pages in the pages library using the content deployment and migration API. If required adjust the page layout of the page based on the page layout configuration for the different labels
  6. Afterwards the new top site is configured as variation top site of the label and the hierarchy of the label will be marked as created

Note: Be aware that the pages in the target label will not be a one-to-one copy of the pages in the source label. Certain field and properties will not be copied as it has to be possible to have different values in source and target. Here is a list of the fields which are not overwritten when creating/updating a page variant:

Title, Description, StartDate, EndDate, Layout, Audience, Contact, LocalContactName, LocalContactEmail, LocalContactImage, PreviousSpawnSourcePageVersion, FieldId.DocumentId, FieldId.AverageRatings, FieldId.RatingsCount

Comments
  • Hi Stefan,

    I like your blog. I have a small question ( big question for me). I created a variation label with En, Hindi and Japanese languages in it. I created a page with some content in it under En and after running 'Variation Propagate Page Definition' The content is still showing in English for the variant sites instead of respective languages. Can you help me.

    Regards

    Suman P.

  • Hi Suman,

    The locale defines the language of the admin interface.

    Content translation is not done by Sharepoint - you need to do this yourself.

    Cheers,

    Stefan

  • Thank you so much for the response I got what you said but what needs to be done if I want the content also to be translated. Any other tools to do it ? Please throw some light.

  • Hi Suman, with SP2013 you can integrate with translation services supporting the XLIFF standard:

    blogs.office.com/.../localization-and-internationalization-improvements-in-sharepoint-2013.aspx

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
Raw Html Fix