Jump to content

[SOLVED] Help Needed - How to change tpl file if ISO is en/de/fr?


Recommended Posts

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

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 neq
I have noticed that without wrapping in a foreach it wont work at all? so your code is no good to me
My version works but duplicates the result 3 times - why is this please prestashop /smarty experts
Thanks
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...