Netlify-cms: File collection at same hierarchy level as folder type collection

Created on 18 Apr 2018  路  2Comments  路  Source: netlify/netlify-cms

Currently there you need an extra hierarchy level of files: to create a file type collection. I fail to see the need for this, as the CMS should be able to infer the correct collection type from the presence of either a folder or a file field.

To the end-user both are similar ways to add and edit data, but one is always hidden one hierarchy level deeper.

I would propose to no longer require the files hierarchy and nest the file collections directly under the collections field. Just like the folder collections.

Additionally: I can see use cases where the hierarchy would be beneficial to have. You could approach this more flexibly with custom "groupings". It would naively look something like this:

[...]
collections:
    - name: blog
      label: Blog
      folder: collections/blog
      create: true
      fields:
        - { name: "title", label: "Blog posting title" }
        - { name: "published", label: "Published", widget: "boolean", default: true}
        - { name: "date", label: "Date", widget: date }
        - { name: "author", label: "Author"}
        - { name: "body", label: "Resume", widget: "markdown" }
  - name: author
    label: Author
    file: collections/author.yaml
    fields:
      # somehow make this a list
      - { name: "id", label: "ID" }
      - { name: "bio", label: "Biography" }
  - group: "News items"
    - name: news
      label: Articles
      folder: collections/news
      create: true
      fields:
        - { name: "title", 
#etc

Most helpful comment

Agreed. This seems to be a duplicate of https://github.com/netlify/netlify-cms/issues/535, you agree @snirp? If so you can thumb that one up (and add any comments) and close this.

All 2 comments

Agreed. This seems to be a duplicate of https://github.com/netlify/netlify-cms/issues/535, you agree @snirp? If so you can thumb that one up (and add any comments) and close this.

Yes, duplicate. Sorry.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dur41d picture dur41d  路  3Comments

ghost picture ghost  路  3Comments

tech4him1 picture tech4him1  路  3Comments

calavera picture calavera  路  3Comments

marcojakob picture marcojakob  路  3Comments