Documentation

Using Fragments

Here you’ll learn how to use some of the common Fragments. These Fragments are covered here:

Using the Content Fragment

Available: Liferay DXP 7.3+.

You can display a single existing web content, blog entry, or document by adding a Content Fragment from the Content Display panel. Follow these steps to use it:

  1. Edit an existing Fragment-supported page (i.e. Content Page, Master Page, or Display Page).

  2. Open the Fragments Panel and expand the Content Display heading and drag the Content Fragment onto the page.

  3. With the Content Fragment selected, click the (Cog icon) icon to open the Fragment Configuration Menu.

    The Content Fragment lets you display a single piece of content.

  4. Click the plus button next to the Content input and select an existing web content, blog entry, or document to display.

Note

Heading fragments cannot have line breaks. This is because Heading fields use text while Paragraph fragments use rich-text fields; only the latter can have multiple line texts separated by a line break.

Using the Container Fragment

You can deploy a single Container fragment or multiple Container fragments on a page. In addition to having multiple Container fragments on a page, these fragments can be nested.

  1. Edit an existing Fragment-supported page (i.e. Content Page, Master Page, or Display Page).

  2. Click the Fragments and Widgets button.

    The Container fragment appears in the Fragments and Widgets menu.

  3. Click the Fragments tab.

  4. Drag and drop the Container fragment onto the page.

  5. Drag and drop your desired fragments or content into the Container.

  6. Add any additional Container fragments to the page.

    Drag additional Container fragments on the page.

  7. Click Publish when finished.

The Page has been published with several Container fragments.