[ic] little loop question

Twentys interchange-users@interchange.redhat.com
Fri Feb 15 03:09:01 2002


14/02/02 18.37.04, Mike Heins <mheins@redhat.com> wrote:

>Quoting Joachim Leidinger (jojo@blackpoint.de):
>> Twentys wrote:
>> > >>                      [loop option=color search="
>> > >>                       ra=yes
>> > >>                       fi=products
>> > >>                       ml=50
>> > >>                       tf=color
>> > >>                 "]
>> > >>
>> > >>                 <option value="[loop-data products color]"> [loop-data
>> > >> products color]</option>
>> > >>                 [/loop]
>> > >> </select>
>> > >>
>> > >> But so I have something like this parameters in my select box
>> > >> blu
>> > >> yellow
>> > >> red
>> > >> blu
>> ...
>> > >Set in your loop:
>> > >un= yes
>> ....
>> > I've already tried, but it doesn't work....
>> > any other idea?
>> > thanks
>> 
>> Try
>> 
>> [loop option=color searc
>>          ra=yes
>>          fi=products
>>          rf=color
>>          ml=50
>>          tf=color
>>          un=1
>>       "]
>>  <option value="[loop-code]"> [loop-code]</option>
>> [/loop]
>> 
>
>This absolutely should work, but I would add:
>
> [loop option=color search="
>          ra=yes
>          fi=products
>	  st=db
>	  ml=1000
>          rf=color
>          tf=color
>          un=1
>       "]
>  <option value="[loop-code]"> [loop-code]</option>
> [/loop]
>
>You have to have a matchlimit as high as your number of products.
>
>Perhaps easier is:
>
>    [query list=1
>	    option=color
>	    sql="select distinct color from products order by color"
>    ]<option>[sql-code]
>    [/query]
>
The last one works very good.
Thank a lot
Roland