Skip to content

Delete front matter values completely if optional string widget left empty in CMS #995

@OrdinaryJellyfish

Description

@OrdinaryJellyfish

- Do you want to request a feature or report a bug?
Request a feature

- What is the current behavior?
When emptying a field in the CMS, then re-publishing, it leaves the example: there

- If the current behavior is a bug, please provide the steps to reproduce.

- What is the expected behavior?
Delete it completely

- Please mention your CMS, node.js, and operating system version.

Netlify CMS 1.0, Node.js 6.12.3

- Please link or paste your config.yml below if applicable.

backend:
  name: git-gateway
  branch: master # Branch to update (optional; defaults to master)
  
publish_mode: editorial_workflow
media_folder: "images"

collections:
  - name: "scripts" # Used in routes, e.g., /admin/collections/blog
    label: "Script Page" # Used in the UI
    folder: "_posts" # The path to the folder where the documents are stored
    create: true # Allow users to create new documents in this collection
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
    fields: # The fields for each document, usually in front matter
      - {label: "Layout", name: "layout", widget: "hidden", default: "script"}
      - {label: "Script Name", name: "title", widget: "string"}
      - {label: "GitHub Username", name: "gh_username", widget: "string"}
      - {label: "Repository Name", name: "repo_name", widget: "string"}
      - {label: "Screenshot", name: "screenshot", widget: "image", required: false}
      - {label: "Documentation URL", name: "doc_url", widget: "string", required: false}
      - label: "Category"
        name: "categories"
        widget: "select"
        options:
         - { label: "Blog", value: "Blog" }
         - { label: "Documentation", value: "Documentation" }
      - label: "Does this repository use Netlify CMS?"
        name: "cms"
        widget: "select"
        options:
         - { label: "No", value: "false" }
         - { label: "Yes", value: "true" }
      - {label: "Description", name: "body", widget: "markdown"}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions