|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
laurentq45 Smarty Rookie
Joined: 14 Sep 2006 Posts: 15 Location: France
|
Posted: Tue Dec 26, 2006 6:58 pm Post subject: [Résolu] Créer une gallerie avec Smarty !! |
|
|
Bonsoir le Forum,
Je souhaite dans une page afficher une galerie de photo, mais je bloque quant à la réalisation.
Dans mon fichier .php, j'ai les liens pour afficher les photos en grand, et url de l'image sous forme de array().
Dans ma& feuille .tpl, je souhaiterai afficher mes photos sur 4 colonnes (<td>). J'ai tenté avec un :
Code: | {foreach key=key item=item from=$photo}
{if iteration==1 or iteration==5 or iteration==9}
<TD><a href={$item.photo_url}><img src={$item.photo}></a></TD>
{if iteration==2 or iteration==6 or iteration==10}
<TD><a href={$item.photo_url}><img src={$item.photo}></a></TD>
{if iteration==3 or iteration==7 or iteration==11}
<TD><a href={$item.photo_url}><img src={$item.photo}></a></TD>
{if iteration==4 or iteration==8 or iteration==12}
<TD><a href={$item.photo_url}><img src={$item.photo}></a></TD>
{/foreach} |
Mais rien ne s'affiche, comme si mon tableau en .php était vide.
Où ai-je fait la bourde ?
Ensuite, ou plutôt dans la même boucle, je souhaiterai avoir une nouvelle ligne (<TR>) toutes les 4 photos. Chaleur pour mes neuronnes.
Merci de votre aide
Laurent
Edit : Toutes mes excuses !!
Mais en fouillant sur Web, j'ai trouvé ça, qui pourra servir à d'autre néophites comme moi
galerie dynamique avec template à adapter bien sûr.
Pour une gallerie simple, le code se trouve dans le chapitre "III-A. affichage galerie.tpl". _________________ Laurent
Tout le monde cherche sa place au soleil
http://www.developpement-interessant.com |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|