# Link your contents to each other

A reference links one content to another, like a property to its city or a product to its brand. This article teaches you to declare a reference field, to link your contents in the editor and to show these links on your pages.

## Understand a reference

A reference links one content to another, for example a property to its city or a product to its brand. It is set by a reference field, which you name and declare on the type of the content that points.

The target content is most often a term of a category, but a field can target any public type. A reference reads both ways: the property shows its city and the city’s page lists its properties.

A type can carry several fields to the same type. A product can thus have a “Main brand” and “Partner brands”, two distinct links to the “Brands” category.

## Declare a reference field

You must be an administrator of the site.

1. In the administration menu, open **Content types**.
2. Click **Edit** on the row of the type that points, for example **Products**.
3. In the **Reference fields** section, click **Add reference field**. A row is added.
4. In **Reference name**, enter the name of the link, for example `Main brand`.
5. In **Target type**, choose the type of the contents to link, for example **Brands**.
6. In **Cardinality**, choose **Single** or **Multiple**.
7. Click **Save**.

| Column | Effect | Default value |
| --- | --- | --- |
| **Reference name** | The name of the link, shown in the editor and in the filters. The technical key is derived from it. If it is already taken, `_2` is added to it. | Empty. |
| **Target type** | The type of the contents that can be linked. The list gives each type with its technical name. | None. |
| **Cardinality** | **Single**: a single content linked, like a main brand. **Multiple**: several, like partner brands. | **Multiple**. |

Renaming a field keeps the links already set. The cross on a row removes the field on save.

**Note:** A type targeted by a reference field cannot be removed. First remove the field from the type that carries it. [Create a content type](https://lovelyrender.com/documentation/create-content-type/) details how to remove a type.

A category targeted by a field appears in the administration menu under the type that targets it. [Sort with a category](https://lovelyrender.com/documentation/sort-with-category/) details this.

## Link a content in the editor

1. Open the content in the editor, for example a product.
2. In the right-hand sidebar, open the document tab, the one that carries the name of the type.
3. Open the **References** tab. Each reference field of the type has its block there, under its name.
4. Click in the **Search…** field. The list shows ten contents of the target type, in alphabetical order.
5. Type a few letters to narrow it down, then click a content. It shows above the field.

![The References tab of a project: the Garden type set to City garden, the Services Planting and Wooden deck, each with its cross, then the search open on Paths and borders, Automatic watering, Fence and gate and Garden lighting.](https://static.lovelyrender.com/uploads/2026/10/889-doc-contenus-references.png)

The link is saved as soon as you choose the content. You do not have to save the open content. The cross on a linked content removes it at once.

A **Single** field no longer shows the search once a content is chosen. To change it, remove it then choose the other.

The search offers published contents, drafts and private contents that you have the right to read. A linked content that is a draft appears on your site only once published.

## Show the references of a content

The **References** block shows, on the page of a content, the contents linked by a field. For example, the brand of a product or the services of a project.

1. In the content or in the template of its type, add the **References** block. [Add a block](https://lovelyrender.com/documentation/add-block/) explains how.
2. In the **Settings** tab of the sidebar, **Reference field** panel, choose the **Field to display**.
3. Format the two blocks it contains, described in the table that follows.

| Block | Role | Setting |
| --- | --- | --- |
| **Reference label** | The name of the field, shown once, for example “Brand”. | **HTML tag**, in the **Label tag** panel. `span` by default. |
| **Reference item** | The template repeated for each linked content. It starts with the title of the content. | **Multiple items**: **Inline, separated by commas** (default) or **Blocks (grid or flex)**, one card per content. |

The **Reference item** accepts the blocks of a list card: the title, the excerpt and the media of the linked content. On a term that has colors and an icon, it takes them. [Show the data of a content](https://lovelyrender.com/documentation/display-content-data/) explains how to show the title or a field of the linked content.

Placed in a template, the block reads the field on the type of the displayed content. A single template thus serves all the types that declare this field.

**Note:** If no reference field exists on your site, the panel says so. First declare a field in **Content types**.

## List the contents that point to a page

On the page of a term, a list can show all the contents that target it: on the page “Lyon”, the properties in Lyon. You do not have to choose them, the list follows your references.

1. Open the term in the editor, or the template of the pages of its category.
2. Add the **Content list** block.
3. In the **Settings** tab, **Query** panel, set **Query source** to **Reference**.
4. Optional: in **Reference field**, choose the field that must point. **Any reference field**, the default choice, accepts them all.
5. Optional: in **Restrict to post types**, check the types to list. With no box checked, the list accepts all types.

![The Query panel of a list placed on the City garden term: the Reference source, its explanation, the Garden type reference field and the Projects box checked under Restrict to content types.](https://static.lovelyrender.com/uploads/2026/10/899-doc-contenus-requete.png)

The list targets the displayed content: the one whose content holds the list, or the one the template shows. In the editor, its preview already shows the contents that target the open term.

Choosing a specific field is useful when a type points twice to the same type. With “Main brand”, Nike’s page lists only the products whose main brand is Nike.

**Note:** A field through which none of the listed types points to the displayed content is followed by **(no listed type points here through this field)**. The list then shows nothing. This happens when a list is copied from one template to another: choose one of the fields offered.

**Tip:** Place the list in the content of the term rather than in its template: AI assistants read it in the Markdown version of the page. To get it on every term without rebuilding it, make it a template: [Start from a content template](https://lovelyrender.com/documentation/start-from-template/).

## List the contents sorted the same way

In the template of the pages of a type that carries a reference field, a list can show the contents sorted like the one being read. On an article of the “Get started” section, it shows all the articles of “Get started”.

1. Open the template of the pages of the type in the editor.
2. Add the **Content list** block.
3. In the **Query** panel, set **Query source** to **Siblings**.
4. In **Shared reference**, choose the field that the contents share. It is chosen automatically when the type has only one.

The list shows everything that points, through this field, to what the content being read targets. The content being read stays in the list, marked as the current content. Its card takes the **Active** state, which you style in the **Styles** tab of the card.

As long as no field is chosen, the list stays empty. The **Siblings** source is offered only in the template of a type that declares a reference field.

## Filter a list by reference

A content list can let your visitors filter by reference, for example by city or by brand. Several values checked in the same filter widen the result, two filters narrow it. [List and filter your contents](https://lovelyrender.com/documentation/list-filter-contents/) details the filters.

## See also

- [Sort with a category](https://lovelyrender.com/documentation/sort-with-category/)
- [List and filter your content](https://lovelyrender.com/documentation/list-filter-contents/)
- [Show a content’s data](https://lovelyrender.com/documentation/display-content-data/)
- [Choose the look with templates](https://lovelyrender.com/documentation/decide-look-templates/)
