mercredi 11 avril 2018

Webshop widget template file div

I have a programming problem. This is a template (.tpl) file. I created an Array (city names) and I wrote these codes in the top of the file:

{assign var=foo value=["Esztergom","Budapest","Kecskemét","Nyíregyháza","Miskolc","Debrecen","Szeged","Békéscsaba","Salgótarján","Pécs","Székesfehérvár","Szombathely","Szolnok","Érd","Kaposvár","Zalaegerszeg","Nagykanizsa","Hódmezővásárhely"]}
{assign var=randomindex value=$foo|@array_rand} 

I want to writing the array items in a div (important to write random city names each items). I wrote these codes in the good position of the file:

<div style="float:right;">{$foo[$randomindex]}                                                                                  
                </div>  

If I write this code, I can see the same city name each items on the webpage. I want to see not the same city names. I prefer random city names from the array next to the items.

How can I do it right? Any ideas what else I can use?




Aucun commentaire:

Enregistrer un commentaire