Reference Field Reference
fields.link()
Hyperlink reference, either internal (document) or external.
Hyperlink reference. Maps to editor { name: 'str-link', type: 'link' }. Output is the canonical Link from @strifeapp/types.
Example
fields.link({
label: 'CTA link',
localizable: true,
})
fields.link({
label: 'Download URL',
linkOnly: true,
})Options
| Option | Type | Required | Description |
|---|---|---|---|
label | string | Yes | Label shown to editors in Strife Studio. |
description | string | No | Not shown in Studio's editor panel. |
localizable | boolean | No | When true, output is Record<string, Link> instead of Link. |
searchable | boolean | No | Stored on the template; nothing uses it today. |
filterable | boolean | No | Stored on the template; nothing uses it today. |
protected | boolean | No | Stops the field from being edited or removed in Studio's template designer. No effect in the editor panel. |
propertyName | string | No | Override the stored property name. |
linkOnly | boolean | No | Meant to show only the URL field. Studio's editor panel ignores it today: the link-text mode is still there, and picking a page fills in its name as the text. |
Output type
Link, or Record<string, Link> when localizable: true. href/target are always present; id is set only for internal-document links (the content index resolves href from it); text can be present even with linkOnly: true, since Studio doesn't apply it.
See also
- The Link field in Studio: the same editor, documented from the Strife Studio UI side.