Creating Collections
This information applies to Liferay DXP 7.3+. For previous Liferay DXP versions, see Liferay DXP 7.2.
You can create Manual or Dynamic Collections. For information about the different types of Collections, see About Collections and Collection Pages.
Creating a Manual Collection
-
Go to Site Administration → Site Builder → Collections.
-
Click on the New button (
) and select Manual Collection.
-
Add a Title for your Manual Collection and click Save.
-
In the Item Type drop-down menu, select the item type you want to include in the Collection.
-
If you want to include only one item type
- Select the type under Single Item Type.
- Optionally, if your Item Type includes a subtype, select this in the Item Subtype drop-down menu.
- Click Save.
-
If you want to include more than one item type
- Select Select More Than One under Multiple Item Types.
- In the dual list box, add or remove the item types you want to include in your collection.
-
-
Click Save.
-
Click Select next to Collection Items and select one of your item types.
-
In the selection dialog, check the items you want to include.
-
Click Add.
-
If your Manual Collection includes more than one item type, repeat steps 6 to 8 for the other types.
Note that Documents and Media folders and Web Content folders can be added to a Collection.
While Documents and Media and Web Content folders can be added to a collection, the content is not displayed when the folder is published on a Collections Page or in an Asset Publisher widget. Even if these assets are added to a collection, they can only be viewed separately. This is a known limitation and will be fixed in a future release.
Creating a Dynamic Collection
-
Go to Site Administration → Site Builder → Collections.
-
Click on the New button (
) and select Dynamic Collection.
-
Add a Title for your Manual Collection and click Save.
-
In the Item Type drop-down menu, select the item type you want to include in the Collection.
-
If you want to include only one item type,
- Select the type under Single Item Type.
- Optionally, if your Item Type includes a subtype, select this in the Item Subtype drop-down menu.
- To filter you Item Subtype by a specific field, enable the Filter by Field switch, click Select, choose the field, and click Apply.
- Click Save.
-
If you want to include more than one item type,
- Select Select Types under Multiple Item Types.
- In the dual list box, add or remove the item types you want to include in your collection.
-
-
Configure the criteria for your Dynamic Collection, based on Scope, Filter, Content Recommendation, or Ordering.
Scope: Define the source of items in your Dynamic Collection. By default, the source is the current site.
Filter: Configure the rules for the items in the Dynamic Collection. For example, you may want to include only items with the “promotion” tag.
TipYou can add multiple rules to your Filter clicking on the Add button. The final content in the Dynamic Collection is the result of adding all the rules.
Ordering: Items in the collection appear using the order criteria you define here.
-
Click Save.
Creating a Collection from an Asset Publisher
You can create a new Collection from an Asset Publisher Widget. This is useful when you have an Asset Publisher customization that you want to use as a Collection in other pages.
-
Go to Site Administration → Site Builder → Pages.
-
Click the Actions button (
) next to the page that contains the Asset Publisher and select Edit.
-
Hover over the Asset Publisher, click the Options icon (
) in the widget’s menu, and select Configuration.
-
In the Asset Publisher - Configuration dialog, click the Setup tab and Asset Selection sub-tab.
-
Scroll down and click Create a Collection from this Configuration.
-
Enter the Title for your Collection and click Save.
-
Close the Asset Publisher - Configuration dialog.
-
Find your new Collection in Site Administration → Site Builder → Collections.
Liferay DXP 7.2
Creating Content Sets
You can create Content Sets through the Content Sets interface in Site Administration. Content Sets can use either Manual or Dynamic selection. You can create any number of Content Sets and display them through the Asset Publisher or custom applications. Content Sets can also have personalized variations that provide different experiences for different users based on criteria that you specify. Criteria management is shared with the Asset Publisher. For more information on each option, see Selecting Assets in the Asset Publisher.
Creating a Manual Content Set
To demonstrate the creation of a Manual Content Set, create a Content Set that contains images to be displayed on the front page of the fictitious Space Program website. To prepare for this exercise, upload some appropriate images to Documents and Media to use for the Content Set.
-
Go to Site Administration → Content & Data and select Content Sets.
-
Click
and select Manual Selection.
-
Name your Content Set Space Program Images.
On the next screen, you can select the assets to include in the Content Set.
-
Click Select → Basic Document.
-
Now, check the boxes for each image that you want to add and click Add.
Now this Content Set can be displayed anywhere on the site where it was created. You can add or remove items from the set, and it will automatically update it wherever it is displayed.
Creating a Dynamic Content Set
To demonstrate the creation of a Dynamic Content Set, create a Content Set that contains a number of varied assets that are tagged as “trending.” In order for this to work, you will need some number of existing assets with the appropriate tag.
- From the Content Sets page, click
→ Dynamic Selection.
- Enter Trending for the name and click Save.
With Dynamic Content Sets, you can choose the Source, Scope, Filter, and Ordering for the items in the set.
-
Leave Source as Any and Scope as Current Site
-
Open Filter, make sure it is set to Contains Any of the following Tags, and then enter “trending” in the Tags box.
-
Open Ordering and set it to Order By: Publish Date, And Then By: Title.
-
Click Save.
This will create a Content Set which will contain any items that are currently tagged as trending and any future items with the trending tag will be added to the Content Set automatically.
Now that you have your Content Sets created, you can display them on a page.
Converting Asset Publisher Configurations to Content Sets
In the previous two guides in this section, you’ve seen Creating Content Sets and Displaying Content Sets demonstrated. Next, try out converting an existing Asset Publisher configuration to a Content Set.
In this case, you have an Asset Publisher on a page, which is configured to display images tagged as trending in reverse alphabetical order by title. This might not be too hard to reproduce in the Content Set creator, but it’s even easier to create the Content Set definition directly from the Asset Publisher.
-
Go to
→ Configuration for the Asset Publisher.
-
Click Create a content set from this configuration.
-
Enter the title and click Save.
And as quickly as that you have a new Content Set that you can use with Asset Publishers anywhere on the site.
Great! You converted your Asset Publisher configuration to a Content Set.