Log in

View Full Version : If Conditions


FatalBreeze
09-02-2007, 05:27 AM
Hello, i was wondering if there is a way to use an "else if" statement in templates?
I know that i can use:
<if condition="$number > 0">bla bla...<else />nope</if>
But is there a way to use elseif?

Thanks in Advance!

calorie
09-02-2007, 06:08 AM
You can nest if-else template conditionals:

<if condition="$number > 2">
blah_2
<else />
<if condition="$number > 1">
blah_1
<else />
<if condition="$number > 0">
blah_0
<else />
nope
</if>
</if>
</if>

FatalBreeze
09-02-2007, 06:25 PM
ok... it's a bit confusing but i guess that will do..
i think the developers should use <else if /> in the next version of vB.