We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23050
    • 1,842 Posts
    Ok ! Ca te permet de fermer ton tr tous les 3 items, c’est ça ?

    Pas mal smiley
      • 2299
      • 62 Posts
      Exactement. Bon, je ne dis pas que c’est incroyable niveau design, mais c’est la fonctionnalité qui est intéressante...

      Pour détailler, voici l’appel de Ditto :
      <table bgcolor="#F7F7FF" border="0" cellspacing="10">
      [[Ditto? &parents=`[*id*]` &display=`all` &sortDir=`ASC` &sortBy=`menuindex` &tpl=`tpl_tableau_titre_image` &showPublishedOnly=`1`]] 
      </table>


      Et voici le template correspondant :
      [+ditto_iteration:modulo=`3`:is=`2`:then=`<tr>`+]
      <td valign="middle" align="center" width="180" border="3" bgcolor="#CED2EE" ><br><a href="[~[+id+]~]"><img src="[+image_document+]" width="120"  height="120"/></a><br><a href="[~[+id+]~]">[+pagetitle+]</a><br><br></td>
      [+ditto_iteration:modulo=`3`:is=`1`:then=`</tr>`+]



      Pour rappel, il faut avoir installé PHx et ajouter le snippet suivant pour que ça marche : phx:modulo
      <?php
      /**
       * [+ditto_iteration:modulo=`n($options)`:is=`1`:then=`Le résultat`+] 
       */
      if ( ( (int)$output + 1 ) % (int)$options === 0 )
      {
          return 1;
      }
      else
      {
          return 0;
      }
      ?>
        • 23050
        • 1,842 Posts
        Ok merci pour ce retour ! smiley