* [DOCS] Runtime fields
* [DOCS] Runtime fields
* Adds examples and Lens changes
* Review comments
* Adds redirects
* Review comments
* Revert "Review comments"
This reverts commit 537732a5cf
.
* Review comments
* Fixes broken link
* Removes duplicate link
Co-authored-by: Kaarina Tungseth <kaarinatungseth@Kaarinas-MacBook-Pro.local>
33 lines
1.7 KiB
Plaintext
33 lines
1.7 KiB
Plaintext
You can specify the following types to the `Url` field formatter:
|
||
|
||
* *Link* — Converts the contents of the field into an URL. You can specify the width and height of the image, while keeping the aspect ratio.
|
||
When the image is smaller than the specified paramters, the image is unable to upscale.
|
||
* *Image* — Specifies the image directory.
|
||
* *Audio* — Specify the audio directory.
|
||
|
||
To customize URL field formats, use templates. An *URL template* enables you to add values
|
||
to a partial URL. To add the contents of the field to a fixed URL, use the `{{value}}` string.
|
||
|
||
For example, when:
|
||
|
||
* A field contains a user ID
|
||
* A field uses the `Url` field formatter
|
||
* The URI template is `http://company.net/profiles?user_id={{value}}`
|
||
|
||
The resulting URL replaces `{{value}}` with the user ID from the field.
|
||
|
||
The `{{value}}` template string URL-encodes the contents of the field. When a field encoded into a URL contains
|
||
non-ASCII characters, the characters are replaced with a `%` character and the appropriate hexadecimal code. For
|
||
example, field contents `users/admin` result in the URL template adding `users%2Fadmin`.
|
||
|
||
When the formatter type is *Image*, the `{{value}}` template string specifies the name of an image at the
|
||
specified URI.
|
||
|
||
When the formatter type is *Audio*, the `{{value}}` template string specifies the name of an audio file at the specified URI.
|
||
|
||
To pass unescaped values directly to the URL, use the `{{rawValue}}` string.
|
||
|
||
A *Label template* enables you to specify a text string that appears instead of the raw URL. You can use the
|
||
`{{value}}` template string normally in label templates. You can also use the `{{url}}` template string to display
|
||
the formatted URL.
|