With Page Versioning enabled, you and your team can work in parallel on multiple versions of your Site’s Pages. Different versions are called variations, which you can create and manage for Widget Pages and Content Pages via the Staging bar. Page versioning maintains a history that you can use to revert changes made to your staged Pages to earlier versions if needed.
Starting with Liferay DXP 7.4, 7.3 Fix Pack 1, and 7.2 Fix Pack 11, you can create variations in Widget Pages and Content Pages. In previous Liferay DXP versions, you could create variations only on Widget Pages. To learn more about variations in these types of pages, see Types of Variations.
You can enable Page versioning for your Pages during initial setup or anytime afterward via the Staging Configuration page. Once enabled, you can create, merge, and publish variations for individual Pages or groups of Pages. You can also manage variation permissions for different User Roles.
If you use Page Versioning and later disable it, the history of Page versions is removed and only the latest published Page versions are preserved. This is true for both Local Live and Remote Live Staging.
Types of Variations¶
Staging provides two types of variations:
Site Pages Variation: This type groups changes for multiple Site Pages into a single variation. They can include both Widget Pages and Content Pages.
Page Variations: This type is for creating variations of an individual Page. They are created within Site Pages Variations and are only available for Widget Pages.
When you import a widget page to a site with page variations enabled, the page is imported as a new variation of the site page’s main variation.
For content pages, use Experiences to create alternative page versions.
Both variation types only affect Pages and do not affect your Site’s content, since all variations in your staging Site share the same content. That said, each variation can use and configure the same content or applications in different ways, and each Site Pages Variation can include different Pages.
Also, Page metadata is not versioned (e.g., layout type, friendly URL). This means changes to metadata are applied to all variations. For example, if a Page template is modified, those modifications are propagated to all Pages configured to inherit changes from the template.
Page templates are not recognized by the Staging framework. This means that existing Page templates are not viewable or editable on a staged Site. If they’re created on a staged Site, they are lost if staging is disabled.
Follow these steps to create new variations of a Page or group of Pages:
Click the Actions button ( ) in the Staging bar, and select Site Pages Variation (for Widget Pages or Content Pages) or Page Variations (for Widget Pages only).
Click the Add button at the bottom right of the modal window.
Enter a name and description for your new variation. You can modify these fields for your variation at any time.
For Site Pages Variations, you can select from the following options to determine if your new variation copies Pages from existing variations:
All Site Pages Variations: Copy all Pages from existing Site Pages Variations.
None (Empty Site Pages Variation): Create a new, empty Site Pages Variation.
[Existing Variations]: Copy all Pages from a single Site Pages Variation.
If you decide to copy Pages from an existing variation, only the latest version marked as ready for publishing is copied.
Click Add to create your new variation.
Once created, you can switch between each version of a Page or group of Pages via the drop-down menus in the Staging bar. For more information, see Site Staging UI Reference.
You can merge two Site Pages Variations. This adds all Pages and Page Variations into a Site Pages Variation without affecting or overwriting its content.
Click the Actions button ( ) in the Staging bar, and select Site Pages Variation.
Click the Actions button ( ) for the variation you want to use as the base for merging, and select Merge.
Select the variation you want to merge on top of the base variation.
When two variations of Site Pages are merged, new Pages that don’t exist in the base variation are added to it. And if a Page exists in both variations, and at least one version of the Page is marked as ready for publishing, the latest version marked as ready is added as a new variation for its corresponding Page in the base variation. Older variations not marked as ready for publishing are not copied.
Managing Variation Permissions¶
You can use permissions to manage user access to variations. See Managing Staging Permissions for more information.