Retrieves and prints text from the dictionary of the online store or the translation files of the theme.
Kuvaus
The tag prints the retrieved text entry in the language of the version the visitor is browsing.
The tag can be used to print text both from the online store's dictionary and the translation files of the theme. If a translation key is included in both the dictionary and the translation files, the dictionary takes precedence.
If the tag is used to print text from a translation file but there is no translation available in the language of the version, the text will be printed in the language of the default version or the first version that has the translation available.
There is a long and short syntax for the tag. When using the short syntax, the escape attribute is the only one available.
Näkyvyys
Toimii näkyvyydessä: globaali
It is possible to use global visibility tags in any page template and within any tag.
Using the long syntax of the {Text} tag
{Text( code: 'ContentLabel', before: '<h1 class="ContentLabel">', after: '</h1>' )} {Text( code: 'CustomContent', escape: false )} In this example, two entries are retrieved from the online store's dictionary with the ContentLabel and CustomContent keys.
Using the short syntax of the {Text} tag
When using the short syntax of the tag, set the key of the text to be retrieved as the name of the tag and insert a % sign ahead of it.
<h1>{\%CustomContent}</h1> {%CustomContent}The escape attribute can be used in the short syntax by adding a backslash (\) at the beginning of the markup. No other attributes are supported by the short syntax.
Attribuutit
In the short syntax of the {Text} tag, only the escape attribute is supported.
If you need other attributes, use the long syntax of the tag.
code:The unique key of a dictionary or translation file entry can be set in the admin panel or translation file.
Sallitut arvot: stringbefore/after:With the
beforeandafterattributes, you can define content that is output before or after the content produced by the tag.Allowed values: text that may contain HTML and Interface markup.
E.g.
before:'<p>This markup appears before the tag's own content.</p>'.after:'<p>This appears after the tag's own content.</p>'
If the tag does not produce any content, the content of the
beforeandafterattributes will also not be displayed.escape:Adds an escape character before quotation marks in the output. The attribute makes it easier to process the tag-produced content when using JavaScript.
Allowed values: true/false. The default value is false.
or:Defines alternative content that is displayed if the tag itself does not produce any content.
Allowed values: text that may contain HTML and Interface markup.
E.g.
or:'Content not found.'
