Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

[Résolu] Créer une gallerie avec Smarty !!

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French
View previous topic :: View next topic  
Author Message
laurentq45
Smarty Rookie


Joined: 14 Sep 2006
Posts: 15
Location: France

PostPosted: Tue Dec 26, 2006 6:58 pm    Post subject: [Résolu] Créer une gallerie avec Smarty !! Reply with quote

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. Rolling Eyes

Merci de votre aide Razz

Laurent

Edit : Toutes mes excuses !!
Mais en fouillant sur Web, j'ai trouvé ça, qui pourra servir à d'autre néophites comme moi Wink
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
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP