Skip to content

Commit cee2ce4

Browse files
committed
Note about link field label and value properties
1 parent 1c143da commit cee2ce4

File tree

1 file changed

+5
-1
lines changed
  • docs/5.x/reference/field-types

1 file changed

+5
-1
lines changed

docs/5.x/reference/field-types/link.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ Like elements, you can also render a complete anchor tag:
8585
{{ entry.myLinkFieldHandle.link }}
8686
```
8787

88-
Craft will figure out the best textual representation of the link—a selected element’s `title`, the URL (sans protocol), or the raw phone number, for example.
88+
Craft will figure out the best textual representation of the link—a selected element’s `title`, the URL (sans protocol), or the raw phone number, for example. That text—or `label`—can be retrieved via the `LinkData` model, in addition to the raw `value`:
89+
90+
```twig
91+
<a href="{{ entry.myLinkFieldHandle.value }}">{{ entry.linkFieldHandle.label }}</a>
92+
```
8993

9094
### Relations
9195

0 commit comments

Comments
 (0)