Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

For a software dev like me who has no idea how to create a cute hand-drawn dashed line, this course just 100% works.

— Ira Zayats, Developer

Entries Fieldtype

Create relationships with other entries in one or more collections. It's not very much like online dating because you can create and link the entries on the fly without leaving the page.

Entries Fieldtype UI
The Entries Fieldtype in action!

Overview

Use this fieldtype to create a one-way relationship with entries of any collection in your site. It's delightfully simple.

Watch how to build a "Related Articles" feature using the Entries Fieldtype

Data Structure

This fieldtype will store an array of ids to the selected entries. They will be augmented in your Antlers templates to give you access to each entry's data.

related_entries:
- 12f9be1f-a12e-4680-b769-639d2d1f1d14
- ea48926d-bf67-4d45-9420-9627a31c37fb

Templating

Loop through the entries and do anything you want with the data.

<ul>
{{ related_entries }}
<li><a href="{{ url }}">{{ title }}</a></li>
{{ /related_entries }}
</ul>
<ul>
<li><a href="/look-at-this">Look at This!</a></li>
<li><a href="/look-at-that">Wait, Look at That!</a></li>
</ul>

Options

collections

array

Configure which collections you want to allow relationships with.

max_items

integer

The maximum number of items that may be selected. Setting this to 1 will change the UI to a dropdown.

mode

string

Set the UI style for this field. Can be one of 'default' (Stack Selector), 'select' (Select Dropdown) or 'typeahead' (Typeahead Field).

query_scopes

string

Allows you to specify a query scope which should be applied when retrieving selectable assets. You should specify the query scope's handle, which is usually the name of the class in snake case. For example: MyAwesomeScope would be my_awesome_scope.

search_index

string

Allows you to specify a search index to be used when searching for entries.

Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →