[ic] nested loops on results page

Schuyler Langdon interchange-users@icdevgroup.org
Thu Nov 7 16:33:18 2002


Sach wrote
> hello everyone,
>
> i have looked through the archives, and there is some mention of this, but
> i still can't quite come up with the result i'm looking for.
>
> anway, i'm trying to basically find a way to modify the stock results
> page, to spit out records in <tr>'s three <td>'s wide, until it runs out
> of records, and then closes everything out. this is something i would
> normally do in jsp or php or whatever using nested loops.
>
> is there some other sexier way of doing this that doesn't require the use
> of nested loops that i'm not aware of? is there anyone that has something
> similar like this working that can give me some help.
>
You pretty much have to modify the existing loop. I've done this by changing
the rows to columns in the foundation results and adding something like this
at the end of the loop:
[item-calc] $xx++; $yy=$xx % 3; return "</tr><tr>" if(!$yy);}[/item-calc]
You could probably also do it with tags, item-increment, alternate and such,
if you want to play around with the ITL, but I think the calc may be faster
(according to the tags doc).

--
Schuyler Langdon
GatorDev