The UID field is a unique identifier that can be used specifically to create SEO-friendly website URLs.

This field requires the content writer to enter a lowercase, space-free unique id such as:  using-the-uid-field. Whatever the writer chooses can be used to create a human-friendly url such as www.example.com/using-the-uid-field.

Each document in a custom type that contains a UID field must have a unique value for this field. This ensures that all your urls will be unique for a given Custom Type.

 

Configuration

You can assign the UID field a Field name, and Field placeholder text that will display in the entry editor.  

A custom type can only ever have one instance of this field. If defined in the Custom Type, the UID becomes a mandatory field for the content writers. 

You can use all past UIDs to query a given content document. This prevents breaking URLs that rely on older UIDs. 

 

JSON Editor

Here is a description of how to build the UID field with the JSON editor. 

A Custom Type can only define one field of type UID, and its API ID must be "uid":

"uid": {
    "type": "UID",
    "config": {
        "label": "Unique ID",
        "placeholder": "Enter a meaningful unique identifier..."
    }
}

 

JSON Reference 

"type": (string, required) Value must equal "UID"

"config": (object, optional) Options listed below
 

config

"label": (string) Sets the label that shows up for the field in the entry editor

"placeholder": (string) Sets a user-friendly placeholder into the field

"useAsTitle": (boolean) If set to true, this field will be used for the document name on the document listing page

 

Old UID Values

A UID field will save all previous UID values 

We save all the previous UID values of a given document so that your old links won’t be broken on your site when you change a UID value.

Because the UID value must be unique, this means that an old UID value can not be reused on a different document. If you try to use an old UID name on a different document you will receive the following error. 

This value is already used by another <custom-type-name> document

 Read this article to learn how to find & unlock a UID value.

Did this answer your question?