Documentation

Saving a Fragment Composition

You can save customized Fragment compositions (Section or Row layout Fragments) as new Fragments, so you can reuse them in your other Fragment-based pages. For example, you may want to save a Grid Fragment composition with a different number of modules per row or a custom grid padding options.

To save the Fragment composition,

  1. Open the Content Page with the Fragment configuration you want to save.

  2. On the Content Page editor, click Selection (Selection) to open the Selection panel.

  3. Select the Fragment composition you want to save.

  4. Click the Options menu (Image Properties) for the selection and choose Save Composition.

    Save the Fragment composition using the Save Composition option in the Options menu.

  5. In the Save as Fragment dialog, provide a Name and other optional information:

    • Fragment Description and Thumbnail.

    • Save Inline Content option, for including inline content such as fragment entries (links, images, text, etc.)

    • Save Mapping Configuration option, for including mapped content.

    • Collection where you want to save the Fragment composition.

      Provide the information for the Fragment composition in the dialog that appears.

    If no Site-specific Fragment Collection exists, the saved Fragment composition is saved automatically to a new Fragment Collection called Saved Fragments.

Using Saved Fragment Compositions

Your can use a saved Fragment composition from the Content Page editor:

  1. Open the Content Page where you want to use the composition.

  2. Click Edit (Edit icon) at the top right.

  3. Click the Fragments and Widgets icon (Fragments and Widgets icon).

  4. Under the Fragments section, find your Fragment composition at the bottom of the Fragments list.

  5. Add the Fragment composition to your page.

    The saved Fragment composition can be used immediately.

Managing Saved Fragment Compositions

Your Fragment compositions are saved in the Fragments page, under the Site MenuDesignFragments. From here, you can manage your composition in the same way you manage other Fragments. For more information, read Managing Page Fragments. Compositions can be exported or imported between Sites just as any other Fragment.

Note

In Liferay DXP 7.1 and 7.2, open the Product Menu, and go to SiteSite BuilderPage Fragments.

The saved Fragment composition can be used immediately.

Note

The latest version of the Liferay Fragments Toolkit supports creation, export/import, and preview of Fragment compositions.