Pattern description on slug field

The Pattern Description field available for string fields is incredibly helpful for non-technical editors, as it allows them to understand why their input might be invalid.

It would be fantastic if this feature could be extended to the Slug field. For instance, when working with Next.js, we often create catch-all dynamic routes. In these cases, we don’t use the standard “Webpage Slug” validation provided by DatoCMS because we want to allow slashes (“/”) in the slug. For example: about-us/the-worlds-coolest-page.

While it’s easy to define a regex pattern to validate this scenario, the inability to pair it with a Pattern Description leaves non-technical editors confused when they encounter an error like:

Field must respect a specific regexp format: /^[a-z0-9]+(?:-[a-z0-9]+)... yada, yada.

Adding the ability to include a Pattern Description for slug fields would provide much-needed context and greatly improve the editor experience.

Great idea! Probably an oversight on our part.

Quick workaround… you can at least specify help text in the slug field presentation settings:

That will show up right above the regex validator hint (which is still confusing to non-technical people, agreed):

Thanks @roger, that is precisely what we are doing for now.

I agree with you @brian1 we’ll try making a quick fix on this. Cannot promise anything, but we’ll try!

1 Like