Go to main content




<txp:text />

The text tag is a single tag which is primarily used to return localized language strings from the txp_lang database table.

Note: only language strings designated with a type of common or public are available to use. All other language string types are reserved for use within the Textpattern system itself.


Tag will accept the following attributes (case-sensitive) as well as the global attributes :

escape="html" v4.6.0+
Escape HTML entities such as <, > and & within text.
Values: See the tag escaping documentation for all possible values.
Default: html.
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.


Example 1: Display some localized text

    <txp:text item="older" />

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.

Other tags used: older.


Version 4.6.0

Accepts L10n replacement tags as attributes.
escape attribute added.

If you notice any kind of problem with this page’s construction or content (outdated information, typos, broken links, or whatever), open an issue to have it sorted. Or have a go at it yourself. :)