Set a Document's Display Name

You can control the display name that appears on a document in the document screen.


There are three ways to set document display names in Prismic:

  • manually, in the document header;
  • automatically, with the useAsTitle property in your Custom Type;
  • or by default.

Set a display name manually

To manually set the display name, click on the document's display name in the menu bar of the editor and enter a title. This title will overwrite any default display name, and it will not change unless you edit it manually.

Set display names automatically

In the Custom Type JSON editor, you can specify what field to use as the document display name. The first time you save the document, Prismic will take the display name from this field. If you edit the field again, the changes will not be reflected in the display name.

In the config object for that field, add a property called useAsTitle with the boolean value true:

Copy
"title" : {
  "type" : "Text",
  "config" : {
    "label" : "Title",
    "useAsTitle" : true
  }
}

This setting is most often used with the UID, Rich Text, and Key Text fields. It also works with the Date, Timestamp, Color, Number, Select, and Embed fields.

Use default display names

If no title is otherwise specified, Prismic will take the first heading in the document as the display name. If there are no headings, Prismic will use the first paragraph or Key Text that it finds.


Was this article helpful?
Not really
Yes, Thanks

Can't find what you're looking for? Get in touch with us on our Community Forum.