ShortCodes Examples
On this page
- Automatically generated switchers shortcodes
- Create simple languages/currencies links
- Create languages links in Shopify navigation
- Insert shortcode to theme customizer
Automatically generated switchers shortcodes
To include languages or currencies switchers via shortcodes, you can use automatically generated shortcodes on the switcher page. E.g. follow next steps to find language switcher shortcode:
- Go to "Settings" -> "Languages" -> "Switchers" page of the LangShop application.
- Select needed switcher or create new.
- Copy automatically generated switcher shortcode.
- Use copied shortcode in any place of your store's content.
Create simple languages/currencies links
You can use [LS_LANGUAGE_TITLE] or [LS_CURRENCY_TITLE] shortcodes to create simple list with links. [LS_LANGUAGE_HREF] and [LS_CURRENCY_HREF] shortcodes allow you to use language/currency switching on the click action. See the usage examples below.
Input
<ul>
<li>
<a href="[LS_LANGUAGE_HREF en]">
[LS_LANGUAGE_TITLE en]
</a>
</li>
<li>
<a href="[LS_LANGUAGE_HREF fr]">
[LS_LANGUAGE_TITLE fr]
</a>
</li>
<li>
<a href="[LS_LANGUAGE_HREF ar]">
[LS_LANGUAGE_TITLE ar]
</a>
</li>
</ul>
Output
<ul>
<li>
<a href="javascript:LangShopSDK.switchLanguage('en');">
English
</a>
</li>
<li>
<a href="javascript:LangShopSDK.switchLanguage('fr');">
French
</a>
</li>
<li>
<a href="javascript:LangShopSDK.switchLanguage('ar');">
Arabic
</a>
</li>
</ul>
Create languages links in Shopify navigation
Use [LS_LANGUAGE_TITLE] shortcode with languages codes to create simple navigation menu.
- Go to "Online Store" -> "Navigation" page of the Shopify store admin.
- Choose needed navigation list or create new.
-
Click "Add menu item" or modify existing:
- Use [LS_LANGUAGE_TITLE ar] shortcode in the "Name" field to display language title by ar code.
- Use #locale=ar hash in the "Link" field to switch language after click action.
- You can add all published languages to your navigation menu.
Insert shortcode to theme customizer
- Go to "Online Store" -> "Themes" page of the LangShop application.
- Click "Customize" for needed LangShop theme.
- Insert shortcode to any text fields you needed to display shortcode output in.