Custom validation settings on fields?

It would be great if there was a custom validation feature available.

Something like the UID validation, but letting us choose what happens.

image

Some examples:

Hey Max,

This is something we’ve thought long and hard about. We’ve also discussed it at length in this blog post:
https://prismic.io/blog/required-fields

We’re very open to discussing this and especially the other suggested solutions that we talked about in the article including:

  • Completely removing null value (plus replacing them by default values)
  • Pre-fill a new document with all default values.
  • Empty document preview
  • Warning at first publication: Avoid empty fields, mostly for SEO

Please read the article in depth so we can discuss easier the pain points and possible solutions when for implementing of a feature like this :grinning:

Thanks.

Thanks Phil, that is an interesting read. And it also sounds like quite a can of worms! :bug:

I agree that text defaults would be bad for content editors who want to use live preview, so I can understand that isn’t something that would be implemented.

However, default labels (which is my use-case specifically) seems fairly innocuous - though maybe that would lead down a slippery slope of “I can have a default label, why not default text?”

What do you think about maximum and minimum length warnings? Something like the UI being orange around a field, or something. That could be used to indicate fields that probably should be default. (And provide guidance for SEO fields).

I suppose it’s a case of me thinking I have a perfectly reasonable use-case - I’m not going to smack ‘required’ on every single field - but once it is possible, people will, and that will be nasty.