[ic] IF question

Matthew T. Snyder interchange-users@interchange.redhat.com
Fri Jun 7 16:36:30 2002


> > >>Hi, I've got the following code in my vertical promo for debugging
> > >> >>purposes:
> > >>
> > >>[if loop-code eq st-13]YES[else]NO[/else][/if]
> > >>
> > >>Why does this return YES for every item every time, no matter which
> > >> >>items
> > >>are being displayed in the promo?
> > >
> > >Because that isn't a valid form for an if-statement in the ITL.
> > >
> > >Ciao
> > >        Racke
> >
> > What code would work to accomplish this?
> >
> > - Grant
>
>
> Possibly
>
> [if-loop-field sku eq st-13]YES[else]NO[/else][/if-loop-field]
>
> [if-loop-data products sku eq st-13]YES[else]NO[/else][/if-loop-data]
>
> [if-loop-param sku eq st-13]YES[else]NO[/else][/if-loop-param]
>
> Untested because I happened to never had to do this on the sku field. You
> may need to put st-13 into "st-13". I don't think [if-loop-code..] or
> [if-loop-field code...] will work.
>
>
> Paul
>

[if [loop-code] eq 'st-13']   might work.  also check out using [if data
products::sku::[loop-code] eq 'st-13'].  You may need to look through the
docs at regexp matching, as well, depending on whether you want to search
for a substring or not.

Matt