it seems that the list widget cannot loop after nested keys #279
-
I wanted to understand if this is intended behavior for a list widget, I am not able to find it in the documentation. This works: - label: "Foundations Keys"
name: "keys"
widget: "list"
fields:
- { label: "Title", name: "title", widget: "string" }
- { label: "Content", name: "content", widget: "string" } keys:
- content: with solid CI/CD and documentation
title: Automation
- content: Intuitive tools, clear APIs, and robust frameworks
title: Developer Experience
- content: Growing usage without exponentially growing tech debt and costs
title: Scalability
- content: Data governance, networking, and access
title: Governance & Security
- content: Clean, consistent, and enriched data for analysis
title: Data Readiness While this doesn't work: - label: "Foundations Keys"
name: "foundations.keys" #<- this doesn't seem to work
widget: "list"
fields:
- { label: "Title", name: "title", widget: "string" }
- { label: "Content", name: "content", widget: "string" } foundations:
keys:
- content: with solid CI/CD and documentation
title: Automation
- content: Intuitive tools, clear APIs, and robust frameworks
title: Developer Experience
- content: Growing usage without exponentially growing tech debt and costs
title: Scalability
- content: Data governance, networking, and access
title: Governance & Security
- content: Clean, consistent, and enriched data for analysis
title: Data Readiness |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Yeah, the So, this should work: - label: "Foundations"
name: "foundations"
widget: "object"
fields:
- label: "Keys"
label_singular: "Key"
name: "keys"
widget: "list"
fields:
- { label: "Title", name: "title", widget: "string" }
- { label: "Content", name: "content", widget: "string" } |
Beta Was this translation helpful? Give feedback.
-
@kyoshino I wonder if this can be changed. We have a variety of dot-nested fields in our metadata. The CMS can read them, but saving entries writes an object it cannot read. |
Beta Was this translation helpful? Give feedback.
Yeah, the
name
cannot contain dots because Sveltia CMS internally keeps an entry draft as a flattened object that uses dot notation for nested objects. I’ll mention the limitation when I create docs for Sveltia 😅So, this should work: