Skip to content

Commit

Permalink
Note about link field label and value properties
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustMiller committed Aug 6, 2024
1 parent 1c143da commit cee2ce4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/5.x/reference/field-types/link.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ Like elements, you can also render a complete anchor tag:
{{ entry.myLinkFieldHandle.link }}
```

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.
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`:

```twig
<a href="{{ entry.myLinkFieldHandle.value }}">{{ entry.linkFieldHandle.label }}</a>
```

### Relations

Expand Down

0 comments on commit cee2ce4

Please sign in to comment.