WDSY Posted January 27, 2011 Share Posted January 27, 2011 I plan to use slidedeck jquery on homepage The slidedeck html code is called using {if $page eq 'index'} HTML CODE {/if} What i need to do is call 3 versions of this slide depending on ISO code used...Here is what I have but so far its calling up the tpl file 3 times? {foreach from=$languages key=k item=language name="languages"} {if $lang_iso eq 'en'} {include file=$tpl_dir./slidedeck-en.tpl} {elseif $lang_iso eq 'de'}{include file=$tpl_dir./slidedeck-de.tpl} {elseif $lang_iso eq 'fr'} {include file=$tpl_dir./slidedeck-fr.tpl} {/if} {/foreach} Any ideas how to do this without it being called 3 times?Thanks in advance :-) Link to comment Share on other sites More sharing options...
Hedrad Posted January 27, 2011 Share Posted January 27, 2011 Hello, You can test this : {if {$lang_iso == en}{include file=$tpl_dir./slidedeck-en.tpl} {elseif ... You don't need the "foreach".Sorry for my poor english... Link to comment Share on other sites More sharing options...
WDSY Posted January 28, 2011 Author Share Posted January 28, 2011 Hello, You can test this : {if {$lang_iso == en}{include file=$tpl_dir./slidedeck-en.tpl} {elseif ... You don't need the "foreach".Sorry for my poor english... Thanks but that does nothing? I have tried with == instead of eq & i have tried != and neqI have noticed that without wrapping in a foreach it wont work at all? so your code is no good to meMy version works but duplicates the result 3 times - why is this please prestashop /smarty expertsThanks Link to comment Share on other sites More sharing options...
WDSY Posted January 31, 2011 Author Share Posted January 31, 2011 Bump Bump Anyone know how to do this in Smarty? Im following instructions set @ smarty but its not working?Thanks Link to comment Share on other sites More sharing options...
WDSY Posted January 31, 2011 Author Share Posted January 31, 2011 Sorted now, Worked it out by not using {else} or {elseif} and removing {foreach} & {/foreach} and wrapping each line with {if..... {/if} Here is how it worked out for me... {if $page eq 'index'} {if $lang_iso == en} English slideshow - removed it for now while it gets fixed{include file=$tpl_dir./slidedeck-en.tpl}{/if} {if $lang_iso == fr} French slideshow - removed it for now while it gets fixed{include file=$tpl_dir./slidedeck-en.tpl}{/if} {if $lang_iso == es} Spanish slideshow - removed it for now while it gets fixed{include file=$tpl_dir./slidedeck-en.tpl}{/if} {/if} 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