Prints the list of the online store's versions that are available to the customer.

Kuvaus

The <ul> list to be printed does not include versions that are closed from visitors or are otherwise unavailable to the customer (versions that are restricted to certain customer groups).

Read more about store and language versions in our user guide.

Syntaksi

{LanguageNavigation(
    showcurrent: boolean,
    type: string
)}

Näkyvyys

Toimii näkyvyydessä: globaali

It is possible to use global visibility tags in any page template and within any tag.

Creating the language navigation menu

{LanguageNavigation(
    before: '
        <ul class="NavigationList DropdownNavigation" id="LanguageNavigation">
            <li>
                <a>
                    <span class="Icon LanguageIcon"></span>{CurrentLanguage}
                </a>',
    after: '
            </li>
        </ul>'
)}

In MyCashflow's default theme, language navigation is implemented using two Interface tags: {LanguageNavigation} and {CurrentLanguage}.

The {LanguageNavigation} tag outputs a list of all the languages of the online store. By default, only the name is printed for each language, i.e., the default output of the {CurrentLanguage} tag. Before the list, a title is also added to the menu as an li element using the {CurrentLanguage} tag, which displays the name of the currently used version. All other versions are printed inside the li element, so that the list can easily be used as a drop-down menu.

The image shows how the menu has been implemented in the MyCashflow default theme:

Attribuutit

showcurrent:

Specifies whether the selected version should be highlighted on the list.

Highlighting is done by adding the class name 'Current' to the list element of the selected version.

Allowed values: true/false. Default value: true.

type:

Defines which one to print: version name or selected language.

Allowed values:

  • 'language': Prints the language of the version as a string.
  • 'name': Prints the name of the version (default value).
before: / after:

With these two attributes, 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 before and after attributes will also not be displayed.

escape:

Adds escape characters to the content printed by the tag, making it easier to use the content in JavaScript code or JSON objects.

Sallitut arvot:
  • true: the attribute adds escape characters before quotation marks
  • false: the attribute does nothing
  • json: the attribute adds escape characters to the output, allowing the content to be used in JSON markup.
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.'