[ic] loop-code

Tim Mirecki interchange-users@interchange.redhat.com
Tue Aug 14 15:49:01 2001


Here's what I am REALLY trying to do...I was attempting to simplify it.

[loop arg="1 2 3"]
     [data base="table" column="price" code="[item-param [loop-code]]"]
[/loop]

Which will first produce:

     [data base="table" column="price" code="[item-param 1]"]
     [data base="table" column="price" code="[item-param 2]"]
     [data base="table" column="price" code="[item-param 3]"]

I want it to get the values for [item-param 1], [item-param 2], etc...

However, it seems to be getting stuck at [item-param 1] and returning that,
without looking up the value for item-param 1. Because of that, it's
actually looking up the code "[item-param 1]" which doesn't exist.

Any suggestions?


-----Original Message-----
From: interchange-users-admin@interchange.redhat.com
[mailto:interchange-users-admin@interchange.redhat.com]On Behalf Of Kevin
Walsh
Sent: Tuesday, August 14, 2001 3:13 PM
To: interchange-users@interchange.redhat.com
Subject: Re: [ic] loop-code

> > Hi, I am trying to do a loop like this:
> >
> > [loop arg="1 2 3"]
> >    [item-param 'modname[loop-code]']
> > [/loop]
> >
> > This loop will return on the page:
> >
> > [item-param 'modname1']
> > [item-param 'modname2']
> > [item-param 'modname3']
> >
> > but obviously I'm trying to get the value for each of those, not that
> > string. Anyone have any ideas??
> >
> change item-param to loop-param ?
> Ven
>
Tim, mixing [item-*] with [loop-*] doesn't work, as you have found.
Fortunately, as ever, there's more than one way to do it.

For instance, you could try this:

    [loop arg="1 2 3"]
        [data table="products" col="modname[loop-code]" key="[item-code]"]
    [/loop]

I'll assume your opening and closing quote mismatch was generated by a
"helpful" email client.  :-)

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

_______________________________________________
interchange-users mailing list
interchange-users@interchange.redhat.com
http://interchange.redhat.com/mailman/listinfo/interchange-users