decap-cms icon indicating copy to clipboard operation
decap-cms copied to clipboard

Feat: support hidden widget in files collections

Open chokeul8r opened this issue 5 years ago • 14 comments

Repo: chokeul8r/gncms

I am attempting to use NetlifyCMS in a Gatsby Landing Page project for the first time. My problem relates to the config.yml file and Template key field in particular. The template key is not showing up in my frontmatter and/or my graphgl query.

backend:
  name: git-gateway
  branch: master

media_folder: static/assets
public_folder: assets

collections:
  - label: "Pages"
    name: "pages"
    files:
      - label: "Home Page"
        name: "home"
        file: "content/home.md"
        fields:
          - {
              label: "Template Key",
              name: "templateKey",
              widget: "hidden",
              default: "home-page",
            }
          - { label: Background Image, name: backgroundimage, widget: image }
          - { label: Title, name: title, widget: string }
          - { label: Sub-Title, name: subtitle, widget: string }
          - { label: Intro text, name: intro, widget: text }
          - { label: Body text, name: body, widget: text }
          - { label: Profile Image, name: profileimage, widget: image }
      - label: "Thank You Page"
        name: "thank-you"
        file: "content/thank-you.md"
        fields:
          - {
              label: "Template Key",
              name: "templateKey",
              widget: "hidden",
              default: "thank-you-page",
            }
          - { label: Title, name: title, widget: string }
          - { label: Intro text, name: intro, widget: text }
          - { label: Image, name: image, widget: image }

chokeul8r avatar Jan 07 '20 23:01 chokeul8r