Hi
Another workaround:
1. You need a placeholder with the number of iteration in your Template.
2. You need PHx and a PHx modifier
1. Ditto manipulation line ~ 933
Beginn of the loop
for ($x=$start;$x<$stop;$x++) {
$template = $ditto->template->determine($templates,$x,0,$stop,$resource[$x]["id"]);
// choose the template to use and set the code of that template to the template variable
...
insert
$resource[$x]['iteration'] = $x;
End of the loop
....
$output .= $renderedOutput;
// send the rendered output to the buffer
}
Now you have the placeholder "[+iteration+]" filled with the current number of the Iteration
2. "install" PHx and create this snippet
phx:modulo
<?php
/**
* [+iteration:modulo=`n($options)`:is=`1`:then=`juhu`+]
*/
if ( ( (int)$output + 1 ) % (int)$options === 0 )
{
return 1;
}
else
{
return 0;
}
?>
adjust it for a nicer looking and use it by this way in your template
[+iteration:modulo=`n`:is=`1`:then=`n-th interation`+]
example to clear floats after every fourth iteration
[+iteration:modulo=`4`:is=`1`:then=`<div class="clearboth"></div>`+]
if you give "2" as parameter for the modulo math, you can simulate the cycle method smarty.
[+iteration:modulo=`2`:is=`1`:then=`cycle_1`:else=`cycle_2`+]
example:
<div style="float:[+iteration:modulo=`2`:is=`0`:then=`left`:else=`right`+]"> left or right? </div>
Thats it.
right, false, whatever, no idea, it work for me and i’m happy
thank you
ciao, Stefan