[ic] another loop question - [SOLVED]

Kevin Walsh interchange-users@interchange.redhat.com
Thu Apr 25 18:55:01 2002


> > > >>  This seems so simple, but here I am 2 hours later and still
> > > >>  cant get it
> > > >>  to work..
> > > >>
> > > >>  [loop
> > > >>            random=1
> > > >>            search="
> > > >>                    fi=testimonials
> > > >>                    st=db
> > > >>                    ra=yes
> > > >>                    ml=1000
> > > >>            "]
> > > >>
> > > >>  I thought the way to call out the value of the field was:
> > > >>  [value FIELDNAME]
> > > >>
> > > >>  But then I also found in the docs:
> > > >>  [loop-field FIELDNAME]
> > > >
> > > >Forgot to add one thing: if you do [loop-code] you get the 
> > field 'code'
> > > >of the table 'testimonials' as searched above (i.e 
> > '00005') but none of
> > > >the rest work.
> > > >
> > > >>  [/loop]
> > > >>
> > > >>  I cant get either to work.  Where am I going wrong?
> > >
> > > did you try [loop-data testimonials fieldname] ?
> > >
> > > Ven
> 
> > If you search the archives, Racke recomended [loop-param 
> > fieldname] which 
> > does the job for me.
> > 
> I tried [loop-param fieldname] and it was still blank.. And [loop-param
> tablename fieldname] doesn't work...
> 
> I had tried [loop-field tablename fieldname] but in doing all the
> combinations I guess I missed the [loop-data table field] and that did
> it!  It's a little crazy though, I really thought that [loop-field
> fieldname] was 'the way' to do it, oh well.
>
[loop-field colname] will not work, as you are not dealing with
a ProductsFiles table.  [loop-field tablename colname] is not the
correct syntax for the tag's parameters.

[loop-data tablename colname] will work, but will perform a new
lookup, duplicating the previous lookup for which you have already
found data.

[loop-param tablename colname] is just wrong.

[loop-param colname] will work if you have "rf=colname" in your
search spec and may turn out to be the most efficient use of
looked-up data in an ICML loop:

    [loop
        search=|
            st=db
            fi=sometable
            rf=foo,bar
            ...
    |]
    code=[loop-code]<br>
    foo=[loop-param foo]<br>
    bar=[loop-param bar]<br>
    ...
    [/loop]

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/