Skip to content

Commit 32b401a

Browse files
authored
Adding new list config
1 parent e39ad2f commit 32b401a

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

src/docs/configuration.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ images:
282282
- media/image-2.png
283283
```
284284

285-
`list` can be an object with `min`, `max` and `default` keys. `min` and `max` define the minimum and maximum number of entries in the array. For example:
285+
`list` can be an object with `min`, `max`, `default` and `collapsible` keys. `min` and `max` define the minimum and maximum number of entries in the array. For example:
286286

287287
```yaml
288288
- name: tags
@@ -296,7 +296,33 @@ images:
296296

297297
This will force the user to enter at least 1 tag and at most 5.
298298

299-
Certain fields (e.g. the [image field](/docs/configuration/image-field)) implement their own list logic (e.g., multi-select UI). If you want to use the default list widget (which allows drag-and-drop reordering and adding/removing items individually), you might need specific configuration depending on the field type, though often setting `list: true` is sufficient.
299+
By default, list entries are collapsible. You can disable this behavior by setting `collapsible` to `false`:
300+
301+
```yaml
302+
- name: tags
303+
label: Tags
304+
type: string
305+
list:
306+
collapsible: false
307+
```
308+
309+
You can also configure the collapsible behavior by setting `collapsible` to an object with `collapsed` and `summary` properties:
310+
311+
```yaml
312+
- name: sections
313+
label: Sections
314+
type: object
315+
list:
316+
collapsible:
317+
collapsed: true # Default collapsed state
318+
summary: "{title} ({index})" # Template string using field values and {index}
319+
```
320+
321+
The `summary` template string can use:
322+
- Field values using `{fields.fieldName}` syntax
323+
- The index of the item using `{index}`
324+
325+
Certain fields (e.g. the [image field](/docs/configuration/image-field)) implement their own list logic for handling multiple elements with the `mutliple` option. You can use either one approach, both result in an array of values.
300326

301327
### Field Types
302328

@@ -345,4 +371,4 @@ To just enable the content merge behavior:
345371
settings:
346372
content:
347373
merge: true
348-
```
374+
```

0 commit comments

Comments
 (0)