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 mapnoA single field definition, repeated: the list stores values instead of objects (Decap, Netlify, Static and Sveltia CMS)
collapsedbooleannoCollapse items by default (default: true)
hiddenbooleannoHide from the editor
hintstringnoHelp text
i18nboolean or stringnoi18n mode
label_singularstringnoSingular label
maxnumbernoMaximum number of items
minnumbernoMinimum number of items
nameOverridestringnoOverride the name in output
requiredbooleannoMark as required
summarystringnoSummary template for collapsed view
thumbnailstringnoImage subfield shown beside a folded item, e.g. src (Sveltia CMS)