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

Matt Flaherty interchange-users@lists.akopia.com
Mon Jun 4 12:57:01 2001


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!

------------------------------^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