Part 1 – The Basics
Part 2 – User Interface
Part 3 – Triggers
Part 4 – Timer Jobs
Part 5 – Configuration Overview
Part 6 – Configuration Internals
Part 7 – Variation Hierarchy Creation
Part 8 – Creating Page Variants
Part 9 – Creating Site Variants
Part 10 – Restructuring the Hierarchy
Part 11 – Variations Fixup Tool
Part 12 – Customization
Part 13 – Logging
Part 14 – Troubleshooting
Part 15 – “View Changes” Button
Part 16 – Translation Support
Part 17 – MOSS 2007 vs. SP 2010
Part 18 – FAQ
Automatic Creation of Page Variants
Usually a page variation is automatically created for a page in the following situations:
-
A new page is added to the source variation label and the following settings are configured:
- Automatically create site and page variations is enabled
- The DisableAutomaticPropagation option is not set to True
-
A page is updated in the source variation label while the shadow page in the target label has been deleted and the following settings are configured:
- Automatically create site and page variations is enabled
- Recreate a new target page when the source page is republished is enabled
- The DisableAutomaticPropagation option is not set to True
The automatic creation is initiated from either the ItemUpdated event or ItemCheckedIn event implemented in the Microsoft.SharePoint.Publishing.PagesListCPVEventReceiver class, which are bound to the Pages library.
If moderation and minor versions are disabled on a Pages library, the ItemCheckedIn event will initiate the content propagation.
If moderation and/or minor versions are enabled on the Pages library, the ItemUpdated event will initiate the content propagation if the item is in either in approved or scheduled moderation state.
Note: Be aware that automatic propagation will not happen if moderation and minor versions are disabled and also the requirement to check-in and check-out items when updating the item is disabled. The reason is that in this situation the ItemCheckedIn event will not fire as not check-in occurs. |
As discussed in an Part 4 the event receiver will create a Scheduled Work Item for the PropogateVariationPageJobDefinition which will perform the content propagation. The same timer job is also responsible to propagate changes done to existing pages in the source label to the target label.
Manual Creation of Page Variants
There are certain situations where customers do not want to have automatic page creation or recreation in the target labels. Therefore automatic page variant creation might be disabled.
In case that automatic page variant creation is disabled it is required to create a variant manually using one of the following options:
a) From the Publish Tab of the Ribbon while browsing the page
Note: You can also create page variants using the Update button in the ribbon. Be aware that this will automatically create/update page variants in all target labels. This option does not only update existing peers but also create new peers in labels where the page has not been variated to using the default options – similar to the automatic creation mode. This behavior prevents granular content updates to existing peers in case that DisableAutomaticPropagation is set to True. |
b) From Site Manager:
Both options redirect to the _layouts/CreatePage.aspx page passing in details about the original item for which the variant should be created like item id, list id, web id and folder the item resides in:
When creating a page variant manually it is possible to select a different but compatible page layout (means a page layout associated with the same content type). You can also choose a different Url name, title and description but not a different site and folder relative path. The page will be created in the peer site of the source site and the same folder in the pages library as the item in the source site. If a different folder location is required you can move the item to the desired folder after it got replicate to the target label.
It is also possible to specify for each created page variant whether to copy the resources used in the page to the target label or to reference them in the source label.
The settings choosen on the page will be passed to the CreateVariationPageJobDefinition timer job within the Scheduled Work Item.
Manual Update of page variants using the UI
Usually content changes are automatically propagated to all existing page variants through the PropagateVariationPageJobDefinition.
Except if automatic content change propagation is disabled by settings the DisableAutomaticPropagation option to False.
In case that automatic propagation is disabled, the only way to force a content update in the target labels is to use the Update Variations option in the Ribbon.
From the Publish Tab of the Ribbon while browsing the page:
Important: Using this action the page will be propagated to all target variation labels. Unlike automatic update operations that means that page variants will also be created in labels which did not have a page variant before the update operation. |
The content propagation will be performed by the PropogateVariationPageJobDefinition timer job.
Permalink
Thank you!! Thanks for taking the time to write this detailed blog post series Stefan. I have thought about Variations but never had time to dig into it much. These posts with clear step-by-step screen shots provide a jump start I couldn't get any other way. I'm sure this will be very helpful to many others too.
How long does it take Google to update? Not soon enough. =)
Permalink
Thank you, I understand now how it works 🙂
Permalink
how to make a link to change language? If we don't want to make it as dropdown list.
thanks
Permalink
Hi SP Dev,
see here blogs.technet.com/…/sharepoint-variations-the-complete-guide-part-12-customization.aspx
Section "Creating a Variation Label Menu Control"
Cheers,
Stefan
Permalink
Can you create a page in a variation site only or does it always need to start by creating a page in the source language for the site and then creating the variations on each variation site?
Permalink
Hi Jeanpierre,
yes you can – but this page will then only live in the specific labe you created it in. The Variation System will not be Aware of this page and the Content will not be replicated to the other Labels.
Cheers,
Stefan
Permalink
Can you have a workflow that only updates certain site variations instead of propagating to all or no site variations. For example I have a site that has regional news in Latin America and would only like to have the article in English, Spanish and Portuguese-Brazilian. They don't want to propagate any of the other 6 language variation sites we have.
Permalink
Hi Jeanpierre,
the way to set this up would be to create variations into all languages and then delete the pages in those labels where they should not appear.
If you configure variations to not recreate deleted pages updates then you get what you are looking for.
Cheers,
Stefan
Permalink
Thanks, Stefan.
Permalink
Sorry. One more question. Is there a way to set the variations to not overwrite the variation sites with the source code of the parent variation site? For example, I update my page in English and it overwrites on the variation sites the English version of the page on all the variation sites. In order to update the variation site, I need to revert to last major version of the page and then make the in language updates.
Permalink
Hi Jeanpierre,
please check the blue box in the “Automatic Creation” section of this article: http://blogs.technet.com/b/stefan_gossner/archive/2011/11/18/sharepoint-variations-the-complete-guide-part-5-configuration-overview.aspx
Cheers,
Stefan
Permalink
Thx Stefan for this helpful variation reference but i am facing a weird problem when i tried to create page variation manually from ribbon button the form of creation is disabled did you see this problem before ?
thx in advance
Permalink
Hi Zahraa,
the button will be disabled in the following scenarios:
1) the page is in a site which has not been variated to target labels
2) page variants exist in all target labels where the parent site has been variated to
3) the page was created in a different label than the source label.
For 1) please check in “manage content and structure” if the parent site is part of the variation hierarchy (should have a purple triangle in the icon).
Cheers,
Stefan
Permalink
Hi Zahraa,
the button will be disabled in the following scenarios:
1) the page is in a site which has not been variated to target labels
2) page variants exist in all target labels where the parent site has been variated to
3) the page was created in a different label than the source label.
For 1) please check in “manage content and structure” if the parent site is part of the variation hierarchy (should have a purple triangle in the icon).
Cheers,
Stefan
Permalink
Hello stefan,
I came across one issue.
Peer Pages which are propogated to unpublished state by Variation Timer Job, i want that pages to be published automatically.
Please suggest something how can i achieve this.
Thanks,
Permalink
Hello, Thank for this very interesting topic. I’m late (I see last comments are from 2014). But I have a question. I have pdf document in english in my source version. I have the same in french but how could I manage it in Variation ? for what I test till now, I have to re-built all the links to the documents in right language. Do you have another solution ?
thanks in advance for your answer. Guillaume
Permalink
Hi Guillaume,
you would indeed have to create the references again.
Cheers,
Stefan