[ic] How to use 'if' to compare item-field inside an item-list?

Jason Kohles interchange-users@lists.akopia.com
Mon Jun 4 14:05:00 2001


On Mon, Jun 04, 2001 at 06:01:47PM +0100, Matt Flaherty wrote:
> Hi list,
> 
> Can anyone help me. I'm confused about the 'if' tag. I want to modify the
> receipt.html page to allow for provisioning of subscription services,
> something different to soft downloads. I tried it like below, but the listed
> item doesn't pass my test. I looked at the documentation on the 'if' tag,
> and it doesn't list item-field as a type, but then I can't seem to figure
> out what would be the right type in this case (value doesn't work). All the
> examples I've seen only seem to test that a value is not empty, which is not
> what I want here. The tag [item-field dl_type] does return the correct
> value, by the way. Please, I'm wracking my brain to pieces!
> 
Use [if-item-field dl_type] instead of [if item-field dl_type], that extra
dash is important.


> ------------------------------^snip------------------------------
> [item-list]
>         [if-item-field download]
>                 [if !value fax_order]
>                         [if item-field dl_type =~ /^serv/i]
>                         [comment]This is a provisioned service[/comment]
>                         This is a provisioned service.
>                         [elsif item-field dl_type =~ /^soft/i]
>                         [comment]This is a soft goods download[/comment]
>                         This is a soft goods download.
>                         [set download_present]1[/set]
>                         [userdb
>                                         function=set_file_acl
>                                         mode="expire 7 days"
>                                         location="[either][item-field
> dl_location][or][item-code][/either
> ]"
>                         ]
>                         [/elsif]
>                         [else]
>                         [comment]Unknown type[/comment]
>                         Unknown type: [item-field dl_type]
>                         [/else]
>                         [/if]
>                 [/if]
>         [/if-item-field]
> [/item-list]
> ------------------------------^snip------------------------------
> 
> Thanks
> -Matt
> 
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users

-- 
Red Hat E-Business Solutions                    Jason Kohles
11480 Sunset Hills Road                         Senior System Architect
Reston, VA 20190                                jkohles@redhat.com