The reference field is a Collection field that you can add to any of your Collections. Instead of using an option field and choosing from a list of predefined values, the reference field allows you to choose from any item from another Collection. You can then use the referenced item’s data in Collection Lists and Collection Pages.

For example, each blog post may have an author. If you edit an author’s information down the road, it will automatically update on the blog post because of the connection that’s created via this reference field.

Common uses

  • Blog Posts Collection referencing an Authors Collection
  • Articles Collection referencing a Category Collection
  • Lessons Collection referencing a Courses Collection
To reference multiple items from a different Collection, use the multi-reference field.

Here we’ll cover:

  • Creating a reference field
  • Referencing items
  • Using the reference field in your design
  • Filtering a Collection list using the reference field

Creating a reference field

A reference field can be added to a new or existing Collection. In Collection settings, click on New Field and then choose the Reference field.

Type image caption here (optional)

Choose a Collection to reference

In this field’s settings, you can choose which Collection you want the current Collection to reference.

 

Other field settings

Like with other fields, you can also specify the label, help text and if the field is required to publish.

Referencing items

Once a reference field is added to the Collection, you can go into your Collection items and set a value for the field. You can choose any item from the Collection you chose in the reference field settings.

 

Using the reference field in your design

You can pull data from a referenced Collection in a Collection Page or a Collection List. You can connect a field to an element or to a style.

Connecting elements

When you add any element into a Collection List or onto a Collection Page, you can get the content for that element from any of the referenced Collection’s fields. 

 

For example, you can connect a category’s name to a heading element and the tag’s icon to an image element.

Type image caption here (optional)

Connecting styling

If the referenced Collection has a color field and image field, you can use these fields to style any element’s background color, border color, text color, or background image.

 

For example, if a category Collection has a color set on each item, when referencing this Collection on blog posts you can color sections, background, or any other element with that color.

Filtering a Collection List using the reference field

There are three powerful ways to use the reference field to filter Collection Lists. For our examples, we’ll be using a Blog Post Collection that references a Category Collection.

  1. Filter by a specific item that’s in the referenced Collection (e.g. Show only the Blog Posts that reference a specific Category)
  2. Filter by current page’s reference (e.g. Show a list of other Blog Posts that have the same Category referenced)
  3. Filter by current page’s reference on the referenced Collection page (e.g. on the Category Collection page, show all Blog Posts that reference that Category)
Filtering by reference fields is only available for Collection lists that are connected to a Collection with a reference field.

Filter by a specific item that’s in the referenced Collection

The reference field can be used to filter Collection lists to show specific items that meet the filter rule. You may want to create a Collection list that displays only items that reference an item from the referenced Collection.

Filter by current page’s reference

You can add a Collection list to a Collection Page and have it only show the items that have the same referenced item as the page’s referenced item. For example, on your Blog Post Collection page you can show a list of other Blog Posts that have the same Category referenced as the current page. This is common for displaying “related content” sections.

To do this, create a Collection List filter with reference field equals current Collection selected.

Filter by current page’s reference on the referenced Collection page

In the above example, we filtered a Collection List on the same Collection Page, but you can also filter a Collection List on the referenced Collection Page. For example, on your Category Collection Page, you can show all Blog Posts that reference that Category.

To do this, create a Collection list filter with reference field equals current Collection selected.

Learn more about Collection List filters.

The reference field cannot be used for sorting or conditional visibility.