sveltia / sveltia-cms

Alternative to Netlify/Decap CMS. Fast, lightweight, Git-based headless CMS. Modern UX, first-class i18n support, open source & free. Made with Svelte.
MIT License
863 stars 43 forks source link

`summary` ignored for `object` in `list` using `types` #62

Closed frankbits closed 11 months ago

frankbits commented 12 months ago
- name: "components"
  label: "Components"
  label_singular: "Component"
  widget: list
  collapsed: true
  summary: "{{fields.text}}" //gets used for all types
  types:
  - name: "text"
    label: "Text"
    widget: object
    collapsed: true
    summary: "{{fields.text}}" //gets ignored (regardless of "list-summary")
    fields:
    - { name: "group", label: "Group", widget: "number", default: "0", hint: "Grouping of components" }
    - { name: "top", label: "Top", widget: number, default: "0", hint: "Top-offset (-48 to unset row-gap)" }
    - { name: "column_count", label: "columnCount", widget: number, default: "1", hint: "Number of columns text should be in." }
    - { label: "Text", label_singular: "Text", name: "text", widget: markdown }

I have to show different summaries based on the type of content. (text, image, ...)

kyoshino commented 12 months ago

I’ve realized that my client’s setup has the same (or similar) issue. It also doesn’t work with the relation widget. (I’m aware of the same issue in Decap/Netlify CMS, though the codebase is totally different.) I’ll rewrite the summary support.

kyoshino commented 12 months ago

In this case,

summary: "{{fields.text}}" //gets used for all types

is supposed to be ignored, but

    summary: "{{fields.text}}" //gets ignored (regardless of "list-summary")

has to work properly, just like an example in the Decap doc.

kyoshino commented 11 months ago

The fix has been deployed. Thanks for your report!