Log in

View Full Version : Template conditionals (multiple IF/ELSE IF conditions)


cinq
02-24-2005, 02:36 AM
What is the syntax like for the template conditional if i want more than 2 cases in an IF condition ?

Eg.
Here's the code for 2 cases.

<if condition="myconditionhere">
My condition is met !
<else />
My condition is NOT met !
</if>

How can I change it such that I have another condition ?

say:

<if condition="myconditionhere">
My condition is met !
<else if condition="my2ndcondition here">
My 2nd condition is met !
<else />
All conditions NOT met !
</if>

Doesn't seem to work, what do I need to change to make it work ? :)

Jolten
02-24-2005, 04:29 AM
no elseif. At least not that I've been able to get to work.

I think you need something like

<if condition="1">
<if condition="2">
1 and 2 true
<else />
1 true 2 false
</if>
<else />
<if condition="2">
1 false 2 true
</else>
all false
</if>
</if>

cinq
02-24-2005, 04:38 AM
I got it to work already but thanks nonetheless :D
For future reference:


<if condition="myconditionhere">
My condition is met !
<else /><if condition="my2ndcondition here">
My 2nd condition is met !
<else />
All conditions NOT met !
</if></if>

deathemperor
02-24-2005, 04:56 AM
this is just very simple to figure out, just like you code PHP