reactjspaasprismic.io

How to do mandatory fields in prismic.io CMS?


I'm using Prismic.io as a headless CMS and bringing content into my React front end. How do I set up a content type so that fields are mandatory?

Here's what I have so far...

{
  "Main" : {
    "uid" : {
      "type" : "UID",
      "config" : {
        "placeholder" : "UID"
      }
    },
    "image" : {
      "type" : "Image"
    },
    "title" : {
      "type" : "StructuredText",
      "config" : {
        "single" : "heading1",
        "placeholder" : "Title..."
      }
    },
    "description" : {
      "type" : "StructuredText",
      "config" : {
        "multi" : "paragraph,em,strong,hyperlink",
        "placeholder" : "Description..."
      }
    }
  }
}

Solution

  • as for now, prismic.io CMS doesn't allow required fields. The only required field is the native "UID" field. They recommend using the in-website preview for publishers to preview the result before shipping content rather than adding constraints in the editor.