Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Help with long or statement
System
I'd like to conduct a test, and perform the step if one of the three dcr fields has a value checked in order to control a line break in a TPL. But am getting an error message. Whats the correct way to string multiple 'or' statements together ?
<if_if expn='({iw_value name="prodresults.Image one"/} eq "Yes"') ||
({iw_value name="prodresults.Image two"/} eq "Yes") || ({iw_value name="prodresults.Image three"/} eq "Yes") '>
.. then do this....
otherwise, skip the above...
Find more posts tagged with
Comments
Adam Stoller
There are several problems with the snippet of code you posted - from such things as: <if_if
to having an extraneous single-quote (') after the first "Yes" - please try typing your expression carefully and then make sure you copy/paste it *exactly* as it appears in your code - in your post - otherwise we spend a bunch of time correcting posting errors instead of focusing on programmatic issues.
Also - as per another thread in this forum - the attribute name is "expr" not "expn" ...
--fish
(Interwoven Senior Technical Consultant)
MattP
This may be handled better with a case statement...
What does your DCT look like? It seems like the Image is in a container. Is this a check box? Could it be a dreap down instead?
<iw_ifcase name='prodresults.Image'>
<iw_case value='One'>
the image is one
</iw_case>
<iw_case value='two'>
the image is two
</iw_case>
<iw_case value='three'>
the image is three
</iw_case>
<iw_case'>
The image is not 1,2 or 3
</iw_case>
Matt
Matthew Petitjean
BOC Group
Murray Hill, NJ 07974 USA
Migrateduser
The point of this OR statement is to determine if any one of the images (via a checkbox) is checked, then insert a line break to place them below the paragraph. If no images are selected, then no line break is to be inserted and the <iw_iterate> will move on to the next occurence.
MattP
So in your scenerio, the user can select more than one image? I think I understand what you are going for, I think it is handled better with a case statement. I would also consider either a drop down or a radio button rather than a checkbox.
If you are looking for more specific code, you will need to post your tpl and dct.
If you really want to use the or statement, I would make the changes below. The two issues fixed were the quotes and the spaces in "Image one" (two and three). I would change that value to Image_one
<if_if expn="({iw_value name='prodresults.Image_one'/} eq 'Yes') || ({iw_value name='prodresults.Image_two'/} eq 'Yes') || ({iw_value name='prodresults.Image_three'/} eq 'Yes') ">
Matthew Petitjean
BOC Group
Murray Hill, NJ 07974 USA