The UI in this lesson may seem different if you've enables the Style Panel Beta! This content will be updated soon!
 

Collection lists are one of two ways to add and design dynamic content from a CMS collection or an Ecommerce collection. You can add collection lists to any type of page. The other way to add dynamic content is with collection pages.

Before getting started

Before you learn about collection lists, check out the following guides:

In this lesson
  1. Adding a collection list
  2. Connecting a collection list to a collection
  3. Designing a collection list
  4. Understanding the anatomy of a collection list
  5. Configuring collection list settings

Adding a collection list

As long as you have one or more collections with items, you can add a collection list to any static page or collection page in your project. You can simply drag a collection list from the Add panel or add one from the Quick find (CMD/CTRL+E).

Connecting to a collection

A collection list is useless unless it’s connected to a collection. Double-click the collection list to open the collection list settings and choose the collection you want from the dropdown.

 

Designing a collection list

Once the collection is chosen, the collection list will display all the items in that collection as empty blocks. You’ll be able to add elements to the list and, once you connect it to a collection field, automatically get correct data for each collection item.

Adding static and dynamic elements

When you drop an element into one of the empty collection item blocks, that item will repeat for all the items in that collection. That’s called “static” content, or content that doesn't come from a collection.

 

Now, when you connect that element to a collection field, then it will automatically replace the content in the element with the content from each collection item. It becomes “dynamic” content because the content is sourced from the CMS.

Connecting elements to collection fields

Follow these steps to connect an element to a collection field:

  1. Select an element in the collection list
  2. Open the Element settings
  3. Check the box labeled “Get <data type> from <collection>
  4. Open the dropdown and choose the collection field you want to get content from
 
Good to know 
Static elements have blue outlines while dynamic elements, or elements that have data coming from the CMS, have purple outlines on the canvas.

Learn more: How to connect each collection field type to the relevant elements

Styling dynamic elements

Just like how adding static elements into a collection list will repeat those items, adding styling to any element (static or dynamic) will apply that styling across all the collection items in that list. For example, if we connect a heading to a field and then style that heading to have a green text color, all the items in that list will have different content, but the same green style.

You can apply dynamic style settings by pulling colors and background images from color and image fields.

 

Understanding the anatomy of a collection list

Collection list wrapper

By default, a collection list wrapper contains the following components: the collection List and the Empty State. If pagination is enabled, it also contains the pagination wrapper. You can add multiple pagination wrappers by duplicating the wrapper.

Collection list

The collection list component contains the collection items of the list. You cannot add other elements to this component.

Collection item

The collection item component contains the actual content that you add to the collection list. Any item dropped here will populate all items in the list. These elements are static until they are connected to collection fields or have conditional visibility applied to them. This will convert them to dynamic elements. In the Navigator, dynamic elements are indicated with a purple icon.

Empty State

The empty state replaces the collection list when there are no items to display for the list. By default, it has a gray background and contains a text block. You can change the styling and replace or add more elements to create a custom empty state.

Pagination

The pagination component contains two link blocks: the previous button and the next button. Each of these can be styled and customized, however, you cannot add other elements to this wrapper.

Learn more: Paginating collection lists

Configuring collection list settings

The collection list has its own settings to control the content that gets displayed. You can also change the layout of a list in many ways. You can access the settings by selecting the collection list wrapper or collection list element and pressing enter or pressing D to open the Element settings panel.

Collection

Here, you can choose which collection you want to connect to your collection list. You can change the collection connected to a collection list only when none of the elements inside of the list are connected to the currently connected collection’s fields.

UI State

This setting allows you to toggle between the Items view and the Empty state view so you can edit that state of the collection list.

This setting doesn’t set the state of a collection list on a live site. The actual state of a collection list is determined by its items. The empty state only shows when there are no items in a collection or when they are filtered out.
Layout

You can keep the list stacked vertically or you can change the layout to columns, similar to the columns element.

Pro tip 
It’s recommended to use flexbox to build equal height layouts for collection lists. Content in each collection item can vary and cause non-flexbox-based column layouts to misalign.
Filters

Adding a filter allows you to show only the collection items you want—the collection items that match one or more criteria that is dictated from the settings.

Learn more: Filtering collection lists

Sort order

Sort order lets you sort collection lists based on a specific field(s).

Learn more: Sorting collection lists

Paginate items

You can paginate collection lists to display a specific number of items/page.

Learn more: Paginating collection lists

Limit items

This option lets you define how many items to show in a collection list and which item to start listing from. For example, you can have your list start at item 5 and show only 3 items. That will show item 5, 6, and 7.

Learn more: Limiting collection items

Need to know 
The max limit per collection list is 100 items unless pagination is enabled. Learn how to use pagination to display more than 100 items in a collection list.