Log in

View Full Version : if statements in templates


ForgotenDynasty
09-07-2008, 06:03 PM
Ok i know you can execute something if a field has a value at all with
<if condition="whatever the field it"> and if that field is filled out it will execute that action
however how can i change it depending on what that field contains

IE i had 2 radio buttons Named.
1)blah
1)whatever

now in stead of checking to see if just the field is filled out i want it to check to see what it contains
then execute based on what the value is.
like:
IF (field1=blah)
{execute this if they mark the blah button}
else
{execute this if they check any thing other then the blah button}

Opserty
09-07-2008, 07:17 PM
You almost go it right... just use two equal signs (==) instead of one and surround "blah" in single quotes ('). ;)

ForgotenDynasty
09-07-2008, 07:21 PM
Php works in templates?

Opserty
09-07-2008, 07:26 PM
To some extent... Template Conditionals (http://www.vbulletin.com/docs/html/main/template_conditionals)

ForgotenDynasty
09-07-2008, 07:31 PM
ooh i should probably read threw that manual. lol
Thank you very much :)

Opserty
09-07-2008, 09:49 PM
Its always a good place to start. :p