Documentation

Managing Page Fragments

As your Site grows, you’ll have many Collections of Page Fragments. You can work with them in several ways:

  • You can edit them directly.

  • You can export and import them.

  • You can move and copy Fragments between Collections.

Managing Collections of Page Fragments

To access the collections management menu, follow these steps:

  1. Open the Product Menu and go to Site BuilderPage Fragments under the Site menu.

  2. Select the Collection you want to manage from the Collections list.

  3. Open the (Actions) menu next to the Collection name.

  4. Select an action for the Collection:

    Edit: change the name or description for the collection.

    Export: Download a .zip file containing all Page Fragments in the Collection without exporting any Collection data. To export the Collection with Collection data, select the Export option from the Actions Menu next to the Collections heading and choose one or more Collections to export. Each collection exports in a separate .zip file.

    Import: Select a .zip file to upload with additional Page Fragments. If you want to replace an existing collection, make sure the box is checked for Overwrite Existing Files. You can import a Collection that was created in Liferay DXP, a Collection created using external tools, or Page Fragments without a Collection. If an imported Fragment has invalid rules, it is automatically saved as a draft.

    Note

    Exporting and importing Page Fragments is the preferred way to share code or bring it into your Site.

    Delete: Remove the current collection and all its contents.

You can export all of the Page Fragments in a Collection.

Managing Individual Page Fragments

To access the Page Fragment management menu, follow these steps:

  1. Open the Product Menu and go to Site BuilderPage Fragments under the Site menu.

  2. Select the Collection containing the Page Fragment you want to manage from the Collections list.

  3. Open the (Actions) menu next to the Page Fragment.

  4. Select An action:

    Edit: Modify the Page Fragment’s code and configuration.

    Rename: Change the Page Fragment’s name.

    Move: Move the Page Fragment to a different Collection.

    Make a Copy: Duplicate the Page Fragment. Duplicated Page Fragments share the same name with (Copy) appended to the end.

    Change Thumbnail: Change the thumbnail image for the Page Fragment.

    Export: Download a .zip file of the Page Fragment.

    Delete: Remove the Page Fragment from the Collection.

Copying a Default Fragment

Availability: Liferay DXP 7.2 SP1+ and Liferay Portal 7.2 GA2+.

Default Page Fragments cannot be directly edited. However, you can copy the default Page Fragment, move it to your custom Collection, and edit it there.

  1. Navigate to the default Page Fragment Collection.

  2. Open the Page Fragment’s Actions (Actions) Menu and select Copy To.

  3. Select the Collection where you want to copy the default Page Fragment.