SharePoint Variations – The complete Guide – Part 9 – Creating Site Variants

Automatic Creation of Site Variants

Usually a site variation is automatically created for a site if the automatically create site and page variations option is enabled in the following situations:

  • A new Publishing Site is provisioned within the source hierarchy

    In this case, the site creation activates the Publishing Feature, which is invokes the FeatureActivated event handler of the Microsoft.SharePoint.Publishing.PublishingFeatureHandler class which initiates the spawning of the site.

  • The Publishing Feature is activated on a site which resides in the source hierarchy

    In this case, the creation is the same as for the previous scenario. That means activating the Publishing feature on a site (e.g. team) in the variation source hierarchy will automatically initiate the creation of variant sites in the target labels.

  • A site which has the Publishing feature activated is moved into the source hierarchy

    In this case, the spawning of the site is initiated from the WebMoved event implemented in the Microsoft.SharePoint.Publishing.CPVAreaEventReceiver class. This event is bound to all sites that have the Publishing feature activated.

As discussed in Part 4 the event receivers above will create a Scheduled Work Item for the SpawnSitesJobDefinition timer job which will perform the site propagation.

 

Manually Creation of Site Variants

There are certain situations where customers do not want to have automatic site creation in the target labels. So the option might be disabled.

In case that automatic site variant creation is not enabled, it is possible to create a variant manually using the following option in Site Manager:

 

This option redirects to http://url-to-source-site/_layouts/NewVariationSite.aspx page passing in details about the original site for which the variant should be created:

When creating a site variant manually it is possible to select a different Title and a different URL name for the site in the target label. The site will always be created in the peer site of the parent site in the source label. If a different location in the target label is required it is possible to move the site to a different location later without breaking the variation link between the sites and without affecting the ability to create variant pages later.

The settings chosen on the page will be passed to the CreateVariationSiteJobDefinition timer job within the Scheduled Work Item.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.