List

Repeatable list of fields (an array of objects), or of a single field (an array of values).

Usage

{{ partial "admin/widgets/list.js" $args }}

By default each item is an object holding the fields. Give field instead to repeat a single field: each item is then its value, an array of strings for a text field.

{{- $args := dict
  "label" (i18n "admin.fields.education.label" 2)
  "name" "education"
  "field" "text_area"
  -}}
{{ partial "admin/widgets/list.js" $args }}
# fields: [text_area]     # field: text_area
education:                # education:
  - text: Master, 2004    #   - Master, 2004

field is the field option of Decap, Netlify, Static and Sveltia CMS. CloudCannon, Pages CMS and Tina CMS take it as the only item of fields, so their list still stores objects.

Parameters

ParameterTypeRequiredDescription
labelstringyesField label
namestringyesField name
fieldsarrayyes, unless fieldArray of field definitions
fieldstring or map—A single field definition, repeated: the list stores values instead of objects (Decap, Netlify, Static and Sveltia CMS)
collapsedboolean—Collapse items by default (default: true)
hiddenboolean—Hide from the editor
hintstring—Help text
i18nboolean or string—i18n mode
label_singularstring—Singular label
maxnumber—Maximum number of items
minnumber—Minimum number of items
nameOverridestring—Override the name in output
requiredboolean—Mark as required
summarystring—Summary template for collapsed view