|
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 |
fgilain Smarty Rookie
Joined: 14 Oct 2006 Posts: 9
|
Posted: Thu Dec 21, 2006 10:20 am Post subject: Boucle et affichage sur 2 colonnes ? |
|
|
Bonjour,
J'ai un code qui fonctionne actuellement, mais j'aimerais maintenant que la boucle affiche 2 résultats (2 liens vers une autre page en fait) par ligne et donc créer 2 colonnes au lieu d'1...
code actuel :
Code: |
<h2><span class="deco">></span>Catalogue par éditeur</h2><br />
<table>
{section name=tab_editeurs loop=$tab_editeurs}
<tr>
<td>
<img src="{$urlsite}css/puce2.gif" alt="" /> <a href="{$urlsite}catalogue-editeur-{$tab_editeurs[tab_editeurs].nom}-e{$tab_editeurs[tab_editeurs].id_editeur|urlencode}"><b>{$tab_editeurs[tab_editeurs].nom|utf8_encode|strtolower|ucwords}</b></a>
{if $show_details == "1"} ({$tab_editeurs[tab_editeurs].nbr_online_products} produits){/if}
<br />
</td>
</tr>
{/section}
</table>
|
Je suis dessus depuis 1 heure et là, je cale..
PS : j'utilise smarty 2.6.2
Merci de votre coup de pouce
Florent
Last edited by fgilain on Sun May 02, 2010 10:22 pm; edited 1 time in total |
|
Back to top |
|
fgilain Smarty Rookie
Joined: 14 Oct 2006 Posts: 9
|
|
Back to top |
|
fgilain Smarty Rookie
Joined: 14 Oct 2006 Posts: 9
|
Posted: Thu Dec 21, 2006 3:50 pm Post subject: |
|
|
sinon, j'ai ça, mais j'ai du rater une incrementation d'index quelque part :
Code: |
<table border=1>
{$smarty.section.tab_editeurs.total} éditeurs ont été trouvés :
{section name=tab_editeurs loop=$tab_editeurs step=2}
<tr>
{section name=td start=$smarty.section.tab_editeurs.index loop=$smarty.section.tab_editeurs.index+1}
<td>
<img src="{$urlsite}css/puce2.gif" alt="" /> <a href="{$urlsite}catalogue-editeur-{$tab_editeurs[tab_editeurs].nom}-e{$tab_editeurs[tab_editeurs].id_editeur|urlencode}"><b>{$tab_editeurs[tab_editeurs].nom|utf8_encode|strtolower|ucwords}</b></a>
{if $show_details == "1"} ({$tab_editeurs[tab_editeurs].nbr_online_products} produits){/if}
</td>
<td>
<img src="{$urlsite}css/puce2.gif" alt="" /> <a href="{$urlsite}catalogue-editeur-{$tab_editeurs[tab_editeurs.index_next].nom}-e{$tab_editeurs[tab_editeurs.index_next].id_editeur|urlencode}"><b>{$tab_editeurs[tab_editeurs.index_next].nom|utf8_encode|strtolower|ucwords}</b></a>
{if $show_details == "1"} ({$tab_editeurs[tab_editeurs.index_next].nbr_online_products} produits){/if}
</td>
{/section}
</tr>
{/section}
</table>
|
Last edited by fgilain on Sun May 02, 2010 10:21 pm; edited 1 time in total |
|
Back to top |
|
ciboulette Smarty Regular
Joined: 13 Jul 2006 Posts: 45
|
|
Back to top |
|
fgilain Smarty Rookie
Joined: 14 Oct 2006 Posts: 9
|
|
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
|