Created
September 2, 2015 06:19
-
-
Save meysampg/0a6524b13b8be8e6205a to your computer and use it in GitHub Desktop.
Automatic load rtl.css for RTL languages in PrestaShop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{* Check for RTL langguages and automatically load rtl.css from CSS folder of theme for RTL languages. *} | |
{foreach from=$languages key=k item=language name="languages"} | |
{if ($cookie->id_lang == $language.id_lang) && (1 == $language.is_rtl)} | |
<link rel="stylesheet" href="{$css_dir}rtl.css" type="text/css" media="screen" /> | |
{break} | |
{/if} | |
{/foreach} |
PrestaShop 1.6 has a bulit-in detector for RTL languages :)) https://github.com/PrestaShop/PrestaShop/blob/1.6/classes/controller/FrontController.php#L1035
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An example of use this code on header.tpl file: