View Full Version : how to create custom if else statements in templates
GotVtec
11-15-2007, 10:58 PM
I created a variable in the global.php file that radomly selects a number, 1 or 2. In my templates I would like to create an if else loop that will display ad1 if the variable equals 1, or ad2, if the variable equals 2.
Is there a tutorial for something like this?
WhaLberg
11-16-2007, 02:10 AM
<if condition="$yourvar == anothervar">your codes<else />your other codes </if>
For example if your variable returns as true or false, basically you need this:
<if condition="$yourvar">your codes</if>
You can also use 'else' there.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.