Entries field
The entries field is a powerful tool for creating and managing content in a structured way.
The entries field allows you to create and manage multiple entries for the same field. It offers editors a flexible alternative to the structure field for when they need to handle a list of content that only consists of one field.
It supports the color
, date
, email
, number
, select
, slug
, tel
, text
, time
, url
field types.
entries:
type: entries
min: 2
max: 4
required: true
field:
type: select
options:
design: Design
architecture: Architecture
photography: Photography
3d: 3D
web: Web
In your templates
To easily loop through your entries and retrieve each entry as field object, you can use the new $field->toEntries()
method:
<ul>
<?php foreach ($page->myEntries()->toEntries() as $entry): ?>
<li><?= $entry->upper() ?></li>
<?php endforeach ?>
</ul>
Preview
