Description
When using the object form of list on a file-type content entry, the PagesCMS UI breaks — showing a single blank item instead of rendering the actual data from the file.
Config that breaks
content:
- name: hours
label: Hours
type: file
path: _data/hours.yml
list:
min: 7
max: 7
collapsible: true
# Also tried:
list:
collapsible:
collapsed: true
summary: "{fields.day}"
Config that works
content:
- name: hours
label: Hours
type: file
path: _data/hours.yml
list: true
Expected behavior
The list should render all 7 entries from the YAML file with min/max locking the count and collapsible allowing items to be collapsed.
Actual behavior
A single blank item is shown instead of the file's actual data. No entries from the YAML are rendered.
Data file (_data/hours.yml)
- day: "Monday"
abbr: "Mon"
time: "8am - 5pm"
- day: "Tuesday"
abbr: "Tue"
time: "8am - 5pm"
# ... 5 more entries
Notes
- The Zod schema in
lib/config-schema.ts defines collapsible as required (no .optional()) when using the object form of list, meaning list: { min: 7, max: 7 } alone is also invalid per schema
list: true (boolean form) works correctly and renders all entries
- Related issue: #342
Workaround
Use list: true and communicate constraints via field descriptions.
Description
When using the object form of
liston afile-type content entry, the PagesCMS UI breaks — showing a single blank item instead of rendering the actual data from the file.Config that breaks
Config that works
Expected behavior
The list should render all 7 entries from the YAML file with
min/maxlocking the count andcollapsibleallowing items to be collapsed.Actual behavior
A single blank item is shown instead of the file's actual data. No entries from the YAML are rendered.
Data file (
_data/hours.yml)Notes
lib/config-schema.tsdefinescollapsibleas required (no.optional()) when using the object form oflist, meaninglist: { min: 7, max: 7 }alone is also invalid per schemalist: true(boolean form) works correctly and renders all entriesWorkaround
Use
list: trueand communicate constraints via field descriptions.