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,
Open the Content Page with the Fragment configuration you want to save.
On the Content Page editor, click Selection () to open the Selection panel.
Select the Fragment composition you want to save.
Click the Options menu () for the selection and choose Save Composition.
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.
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:
Open the Content Page where you want to use the composition.
Click Edit () at the top right.
Click the Fragments and Widgets icon ().
Under the Fragments section, find your Fragment composition at the bottom of the Fragments list.
Add the Fragment composition to your page.
Managing Saved Fragment Compositions¶
Your Fragment compositions are saved in the Fragments page, under the Site Menu → Design → Fragments. 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.
In Liferay DXP 7.1 and 7.2, open the Product Menu, and go to Site → Site Builder → Page Fragments.
The latest version of the Liferay Fragments Toolkit supports creation, export/import, and preview of Fragment compositions.