A question about conditionals

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mijae
    Senior Member
    • Feb 2003
    • 399

    A question about conditionals

    After adding a few of them I got confused.

    How do they work? Say I have conditionals to show a message A, B and C to users based on activity criteria. Now I've added a condition D.

    What happends when someone meets condition A, and D also, which one will show?
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    Originally posted by Mijae
    What happends when someone meets condition A, and D also, which one will show?
    That depends on your conditional code. For example:

    Code:
    <if condition="A">
    	STUFF FOR A
    </if>
    
    <if condition="D">
    	STUFF FOR D
    </if>
    In this case, both will show. However, in this code:

    Code:
    <if condition="A">
    	STUFF FOR A
    <else />
    	<if condition="D">
    		STUFF FOR D
    	</if>
    </if>
    In this case, A will show but D will not because the D condition is only checked if A is false.

    Comment

    • Mijae
      Senior Member
      • Feb 2003
      • 399

      #3
      Oh ok, I got the second one with else in it. I got it working all right now

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...