ddmbrands Posted January 23, 2013 Share Posted January 23, 2013 (edited) In order to customize my product page individually, I used the unique product reference ast a body class <div class="{$product->reference|escape:'htmlall':'UTF-8'}"> How can I do something similar with the language ID, however I would like to do an if Statement like the following: {if $lang_iso == 1 }Foo in English{else} Foo In Spanish{/if} The above code isn't working for me. Can someone help me with the syntax for identifying a specific language? This {if $lang_iso == 1 } seems to be wrong. Edited January 23, 2013 by ddmbrands (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted January 24, 2013 Share Posted January 24, 2013 Hi There, $lang_iso would be "en", since ISO is the actual language iso code, not the language id. Using the ID would be a bit complex. For that, you should create a foreach loop like "foreach from=$languages" and if the lang_iso variable matches the current iso, assign the language id to a new variable, so that you can further test it. of course, using only language isos would be easier Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now