Click New Page shows empty page

- name: "pages"

    label: "Pages"

    create: true

could anyone help please?

Hey @franva,
Were you able to get this working?

nope, I was trying to find the related documentations, but then I lost in them…

Could you please share your config.yaml? It looks like you maybe don’t have a template associated with that collection. Here are some docs about setting up your config.yaml based on what you want the page to look like:
https://www.netlifycms.org/docs/add-to-your-site/#collections

backend:

  name: git-gateway

  branch: master

  repo: franva/askwinston

  commit_messages:

    create: 'Create {{collection}} “{{slug}}”'

    update: 'Update {{collection}} “{{slug}}”'

    delete: 'Delete {{collection}} “{{slug}}”'

    uploadMedia: '[skip ci] Upload “{{path}}”'

    deleteMedia: '[skip ci] Delete “{{path}}”'

media_folder: static/img

public_folder: /img

publish_mode: editorial_workflow

local_backend: true

collections:

  - name: "blog"

    label: "Blog"

    folder: "src/pages/blog"

    create: true

    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"

    fields:

      - {label: "Template Key", name: "templateKey", widget: "hidden", default: "blog-post"}

      - {label: "Title", name: "title", widget: "string"}

      - {label: "Publish Date", name: "date", widget: "datetime"}

      - {label: "Description", name: "description", widget: "text", required: false}

      - {label: "Featured Post", name: "featuredpost", widget: "boolean", required: false}

      - {label: "Featured Image", name: "featuredimage", widget: image, required: false}

      - {label: "Body", name: "body", widget: "markdown"}

      - {label: "Tags", name: "tags", widget: "list"}

  - name: "pages"

    label: "Pages"

    create: true

    files:

      - file: "src/pages/index.md"

        label: "Landing Page"

        name: "index"

        fields:

          - {label: "Template Key", name: "templateKey", widget: "hidden", default: "index-page"}

          - {label: Title, name: title, widget: string}

          - {label: Image, name: image, widget: image}

          - {label: Subheading, name: subheading, widget: string}

          - {label: Mainpitch, name: mainpitch, widget: object, fields: [{label: Description, name: description, widget: text}]}

          - {label: Intro, name: intro, widget: object, fields: [{label: Heading, name: heading, widget: string}, {label: Description, name: description, widget: text}, {label: Blurbs, name: blurbs, widget: list, fields: [{label: Image, name: image, widget: image}, {label: Text, name: text, widget: text}]}]}

          - {label: Main, name: main, widget: object, fields: [{label: Heading, name: heading, widget: string}, {label: Description, name: description, widget: text}, {label: Image1, name: image1, widget: object, fields: [{label: Image, name: image, widget: image}, {label: Alt, name: alt, widget: string}]}, {label: Image2, name: image2, widget: object, fields: [{label: Image, name: image, widget: image}, {label: Alt, name: alt, widget: string}]}, {label: Image3, name: image3, widget: object, fields: [{label: Image, name: image, widget: image}, {label: Alt, name: alt, widget: string}]}]}

      - file: "src/pages/about/index.md"

        label: "About"

        name: "about"

        fields:

          - {label: "Template Key", name: "templateKey", widget: "hidden", default: "about-page"}

          - {label: "Title", name: "title", widget: "string"}

          - {label: "Body", name: "body", widget: "markdown"}

@franva the concept of creating new file entry doesn’t work for file collection. https://www.netlifycms.org/docs/collection-types/#file-collections

@erez I think the new button shouldn’t show for files collections to avoid confusion.

1 Like

Many thanks for chiming in @Barth! I’ve filed an issue for this in the netlify-cms repo. @franva, feel free to follow along there and, if you want, add additional details that would have helped you.

1 Like

thanks @Barth and @jen

I guess the reason why the concept of creating new file entry doesn’t work for file collection is: each page/file has different fields/properties, not like the blogs that they all share same structure.
It does make sense.

My thought is: could we make it happen even for file collection by allowing use selecting different fields/widgets e.g. string, image, relation, object, map etc. one after another to insert fields/properties on the new page they are creating.

Is it possible?

Use a folder collection with the variable types list widget: https://www.netlifycms.org/docs/beta-features/#list-widget-variable-types

1 Like

this looks promising ~!

I’d like to give it a try later.

1 Like