Documentation

Propagating Fragment Changes

By default, changes to the Fragment’s configuration do not propagate automatically to the Content Pages using the Fragment. For example, if you use a Button Fragment of Primary type and then change the configuration to use the Secondary type, a Content Page using the Fragment does not reflect the change by default.

Using Fragment Propagation, you can modify this behavior and propagate your Fragment changes to the elements where the Fragment exists. Propagation includes changes in the Fragment configuration and code (HTML, CSS, and JavaScript). In addition to Content Pages, Propagation affects other elements where you use the Fragment, like Master Pages, Page Templates, and Display Page Templates.

Note

Changes to existing Fragment editable fields don’t propagate to avoid overwriting content in Content Pages. To force the propagation in an editable field, you must change the field ID. The content on that field does not longer appears in the Content Page when the changes are propagated, but you can retrieve the content from the database using the old field ID. To learn more, read Fragment Specific Tags and Attributes Reference in the developer documentation.

You can propagate the Fragment changes in two different ways:

Propagating Changes Manually for a Single Fragment

You can update all elements where you use a Fragment with the most recent Fragment configuration. Use this procedure after updating the Fragment with the desired changes.

  1. Go to Site AdministrationSite BuilderFragments.

  2. Under Collections, click the Collection containing your Fragment.

  3. On the Fragment, click the Actions (Actions) menu and select View Usages.

    Select the View Usages option from the Fragment's Action Menu.

    Tip

    If the View Usages option is unavailable, the Fragment is not in use.

  4. The Usages and Propagation list shows the elements containing the Fragment (A). Check the element or elements you want to update with the latest configuration. If you want to select all the elements, click All under Usages and check the box in the list header (B). The Using column (C) provides information about the Fragment configuration in use:

Latest Version: The element uses already the latest Fragment changes. You don’t need to propagate changes to these elements.

A Previous Version: The element uses a previous Fragment configuration.

  1. Click the Propagate (Propagate) button (D) to update the elements selected with the latest Fragment changes.

    Select the elements where you want to propagate the latest Fragment changes.

Propagating Changes Automatically for All the Fragments

Using this option, any Fragment change propagates automatically to all elements where the Fragment exists. You need access to the Liferay DXP System Settings to configure this option.

Warning

Automatic propagation can lead to unintended consequences in the production environment, such as typos or inaccurate content being published. Use Automatic propagation only for testing or development purposes.

  1. Click on the Global Menu (Global Menu).

  2. Go to Control PanelConfigurationSystem Settings.

  3. Under the Content and Data section, click Page Fragments.

  4. Check the Propagate Fragment Changes Automatically to enable Fragment Propagation for all your Fragments.

  5. Click Save.

When you enable the Propagate Fragment Changes Automatically, the Fragments Editor shows the Automatic Propagation Enabled message.

The Fragment Editor shows an information message when you enable Fragment Propagation for all the Fragments.