Default value not populating

In my admin for Netlify CMS it does not seem to be populating default for any field.

Here is my package.json

{
  "name": "gatsby-starter-hello-world",
  "private": true,
  "description": "A simplified bare-bones starter for Gatsby",
  "version": "0.1.0",
  "license": "MIT",
  "scripts": {
    "build": "gatsby build",
    "develop": "gatsby develop",
    "format": "prettier --write src/**/*.{js,jsx}",
    "start": "npm run develop",
    "serve": "gatsby serve",
    "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\""
  },
  "dependencies": {
    "babel-plugin-styled-components": "^1.10.6",
    "gatsby": "^2.13.18",
    "gatsby-plugin-netlify-cms": "^4.1.6",
    "gatsby-plugin-prefetch-google-fonts": "^1.4.2",
    "gatsby-plugin-react-helmet": "^3.1.2",
    "gatsby-plugin-styled-components": "^3.1.2",
    "gatsby-remark-component": "^1.1.3",
    "gatsby-source-filesystem": "^2.1.6",
    "gatsby-transformer-remark": "^2.6.9",
    "netlify-cms-app": "^2.9.6",
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "react-helmet": "^5.2.1",
    "rehype-react": "^4.0.1",
    "styled-components": "^4.3.2"
  },
  "devDependencies": {
    "prettier": "^1.18.2"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/gatsbyjs/gatsby-starter-hello-world"
  },
  "bugs": {
    "url": "https://github.com/gatsbyjs/gatsby/issues"
  }
}

Here is my config.yml

backend:
  name: github
  branch: dev
  repo: mikewgd/mikewgd

media_folder: static/img
public_folder: /img

collections:
  -
    name: entries
    label: 'Portfolio Entries'
    folder: src/pages/portfolio/entries
    create: true
    slug: 'portfolio/{{slug}}'
    editor:
      preview: false
    fields:
      - {label: "Template Key", name: "templateKey", widget: "hidden", default: "src/pages/portfolio/entry.js"}
      -
        label: Title
        name: title
        widget: string
      -
        label: 'Cover Image'
        name: coverImage
        widget: image
        allow_multiple: false
      -
        label: Blurb
        name: blurb
        widget: text
      -
        label: Description
        name: description
        widget: markdown
      -
        label: Entry URL
        name: entryUrl
        widget: string
        required: false
      -
        label: Tags
        name: tags
        widget: select
        multiple: true
        options:
          - Vue.js
          - SCSS/CSS
          - ES6
          - React.js
          - Contentful
          - Angular.js
          - Stylus/CSS
          - Node.js
          - MySQL
          - jQuery
          - Webpack
          - Contentful UI Ext
          - Paper.js          
          - AWS
          - Gulp
          - Vanilla JS
          - PHP
      - label: "Media"
        name: "media"
        widget: "file"
        required: false
        media_library:
          config:
            multiple: true
      -
        label: "Created"
        name: "created"
        widget: "datetime"
  -
    label: Pages
    name: pages
    files:
      - 
        label: 'Portfolio Page'
        name: portfolio
        file: src/pages/portfolio/index.md
        fields:
          -
            label: 'Page Header'
            name: pageHeader
            widget: markdown
      -
        label: 'About Page'
        name: about
        file: src/pages/about/index.md
        fields:
          -
            label: 'Page Header'
            name: pageHeader
            widget: markdown
          -
            label: Body
            name: body
            widget: markdown
      -
        label: 'Home Page'
        name: home
        file: src/pages/index.md
        fields:
          -
            label: 'Page Header'
            name: pageHeader
            widget: markdown
          -
            label: 'Entries Header'
            name: entryHeader
            widget: string
            default: "dfsdfsd asdf asdf"

Anything with default does not show up in the input. It works for the portfolio entries, but the pages do not work. I have tried making them string widget, but still does not work.

Hiya @mikewgd!

Sorry for the slow reply but I wanted to check in with our CMS developers. They haven’t heard about this situation before and at first glance that seems like it should work, so we think it may be a bug.

Could you try either filing an issue on GitHub here: https://github.com/netlify/netlify-cms/issues , or pinging the maintainers in their gitter chat here: https://gitter.im/netlify/NetlifyCMS with a quick recap of the situation and a link to this post which contains I think enough information for them to troubleshoot?

1 Like

No problem @fool!

I did post something on gitter.

I was told that default only works on folder collections.

aha, thanks for that followup!

Hopefully you felt empowered to create a feature request to accommodate your workflow?

1 Like