Prismic won't allow me to create the second page, because there's already a document with the UID "web-development".
I guess I could use a Key Text field (instead of a UID field) to represent a page's URL slug – but then I can't make the field required, and I can't prevent content authors from creating duplicate URLs.
As you noted, UIDs are unique among Custom Types. For your use case — having the same UID for two different paths — we would recommend creating two different Custom Types. In this case, a "Capabilities" Custom Type and a "Tutorials" Custom Type. That way you can avoid name-spacing issues, and make use of all of the benefits of the UID field (truly unique, required, getByUID() helper functions, etc).
Otherwise, it is certainly possible to use the Key Text field to construct your URL path, but we wouldn't recommend it for the reasons you described — it isn't necessarily unique, or required, and it's also not encoded for a URL.
I hope that helps! Let me know if you have other questions.
Sam
1 Like
samlittlefair
(Sam Littlefair)
closed , flag & select 'Something Else' to reopen.
7
This issue has been closed due to inactivity. Flag to reopen.