The Link field is used for adding links to the web, to documents in your Prismic repository, or to files in your Prismic media library.
There are three types of links:
- Link to an external URL (This can also be used for mailto & tel links)
- Link to another document in the current Prismic repository.
- Link to a file in your media library, which can be any kind of file (like a PDF, image, or audio file for instance)
By default a Link field will allow an author to select any of these options. If you wish to restrict an author to only select another document, use the Content Relationship field. If you wish the author to only select a media item, use the Link to Media field.
Assign the Link field a Field name, API ID, and Field placeholder that will display in the entry editor. You can also click the checkbox which will allow authors to select that a given link will open in a new tab.
You can configure the link field to only allow an author to select a Link to the Web. Refer to the examples below to see how to add this configuration.
The following is a link to anything (external URL, internal content, or media library file):
"label": "Link to Anything",
"placeholder": "Link to anything..."
The following is a link only to an external URL and it allows the author to select the "Open in a new tab" option:
"label": "Link to the Web",
"placeholder": "Add a link to the web",
"allowTargetBlank" : true
"type": (string, required) Value must equal "Link"
"config": (object, optional) Options listed below
"label": (string) Sets the label that shows up for the field in the entry editor
"placeholder": (string) Sets a placeholder to display in the select dropdown
"select": (string) Set to "web", it restricts the link to only select a "Link to the web"
"allowTargetBlank": (boolean) If set to true, will allow an author to select the "Open in a new tab" option