Skip to content

Commit 5f750a3

Browse files
authored
Merge pull request #1078 from ExpressionEngine/feature/7.x/file-xx-fields-in-textarea
Use `{file:XX:title}`, `{file:XX:description}` in other fields
2 parents 036521a + 5df5ebf commit 5f750a3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/fieldtypes/textarea.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ The Textarea is a simple free-form writing space where you can enter text or HTM
1313

1414
![textarea field](_images/field_textarea.png)
1515

16+
[TOC=2]
17+
1618
## Field Settings
1719

1820
### Textarea Row Height
@@ -34,3 +36,23 @@ Either left-to-right, or right-to-left.
3436
### Field Tools
3537

3638
Show formatting buttons to make writing markup easier, show a smiley chooser, or show a file chooser button to easily insert images or links to files.
39+
40+
## Parsing File Tags
41+
42+
The Textarea fieldtype supports the use of file tags in the format `{file:XX:field}` where `XX` is the file ID and `field` is any field associated with that file, such as `url`, `filename`, `title`, etc.
43+
44+
When the content of a Textarea field is parsed for display, these tags will be replaced with the corresponding values from the file model.
45+
46+
For example, if you have a file with ID `5`, and you want to insert its URL into the Textarea content, you would use the tag `{file:5:url}`. When the content is rendered, this tag will be replaced with the actual URL of the file.
47+
48+
The supported fields for file tags include:
49+
- `url`: The absolute URL to the file.
50+
- `file_name`: The name of the file.
51+
- `title`: The title of the file.
52+
- `description`: The description of the file.
53+
- `file_size`: The size of the file in bytes.
54+
- `width`: The width of the file in pixels.
55+
- `height`: The height of the file in pixels.
56+
- `mime_type`: The MIME type of the file.
57+
- `location`: Where the photo was taken
58+
- `credits`: Photo credits

0 commit comments

Comments
 (0)