SharePoint Variations – The complete Guide – Part 8 – Creating Page Variants

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.

17 Comments


  1. 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.  =)

    Reply

  2. Thank you, I understand now how it works 🙂

    Reply

  3. how to make a link to change language? If we don't want to make it as dropdown list.

    thanks

    Reply

  4. 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?

    Reply

  5. 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

    Reply

  6. 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.

    Reply

  7. 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

    Reply

  8. Thanks, Stefan.

    Reply

  9. 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.

    Reply

  10. 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

    Reply

  11. 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

    Reply

  12. 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

    Reply

  13. 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,

    Reply

  14. 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

    Reply

    1. Hi Guillaume,
      you would indeed have to create the references again.
      Cheers,
      Stefan

      Reply

Leave a Reply to Jeanpierre Caramanica Cancel 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.