Skip to content

Commit 37733b7

Browse files
committed
Update text tag
1 parent c3c9064 commit 37733b7

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

tags/text.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,17 @@ tags:
2121
<txp:text />
2222
~~~
2323

24-
The **text** tag is a *single* tag which is primarily used to return localized language strings from the `txp_lang` database table.
24+
The **text** tag is a *single* tag which is used to return localized language strings from the `txp_lang` database table.
2525

26-
Note: only language strings designated with a type of [`common`](https://github.com/textpattern/textpacks/blob/main/lang/en.ini#L265) or [`public`](https://github.com/textpattern/textpacks/blob/main/lang/en.ini#L776) are available to use. All other language string types are reserved for use within the Textpattern system itself.
26+
Note: only language strings designated with a type of [`common`](https://github.com/textpattern/textpacks/blob/main/lang/en.ini#L265) or [`public`](https://github.com/textpattern/textpacks/blob/main/lang/en.ini#L776) are available to use. All other language string types are reserved for use within the Textpattern back-end system itself.
2727
{: .alert-block .information}
2828

2929
## Attributes
3030

3131
Tag will accept the following attributes (**case-sensitive**) as well as the {% include atts-global-link.html %}:
3232

33-
`escape="html"` <span class="footnote warning">v4.6.0+</span>
34-
: Escape [HTML entities](https://developer.mozilla.org/en-US/docs/Glossary/Entity) such as `<`, `>` and `&` within text.
35-
: **Values:** See the [tag escaping](/tags/learning/#tag-escaping) documentation for all possible values.
36-
: **Default:** `html`.
37-
3833
`item="text"`
39-
: Piece of text to display, preferably an item from the `name` column of the `txp_lang` database table. If the given item matches a key there, the contents of the respective item in the `data` column will be returned. Otherwise, whatever you supply as the `item` value is returned verbatim.
34+
: Piece of text to display, preferably an item from the `name` column of the txp_lang database table. If the given item matches a key in the currently selected site language, the contents of the respective item in the `data` column will be returned. Otherwise, whatever you supply as the `item` value is returned verbatim.
4035

4136
## Examples
4237

@@ -48,7 +43,17 @@ Tag will accept the following attributes (**case-sensitive**) as well as the {%
4843
</txp:older>
4944
~~~
5045

51-
Outputs the text 'older' inside the `<txp:older />` tag, respecting the current Textpattern language, instead of using the tag like this: `<txp:older>older</txp:older>` which would always render the English text 'older', it replaces the contents with the value assigned to the name 'older' in the current language. So you would see a link with the word 'älter' if you were using German `de` as the Textpattern site language.
46+
Replaces the contents of the tag with the value assigned to the name 'older' in the current site language. It takes this information from the matching key 'older' in the txp_lang database table. So if you were using German `de` as the Textpattern site language, you would see a link with the word 'älter'.
47+
48+
If, however, you had used the `<txp:older>` tag tag like this:
49+
50+
~~~ html
51+
<txp:older>
52+
Older
53+
</txp:older>
54+
~~~
55+
56+
then it would always render English text, which is undesirable if your site is changed to show content in a different language.
5257

5358
Other tags used: [older](/tags/older).
5459

0 commit comments

Comments
 (0)