MyBB Community Forums

Full Version: How do I use a if and else on template editor?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to check a variables value to do a if/else on the template editor but none of it seems to work.
I tried using this:
<if {$memprofile['uid']} == 2 then><div>show this</div></if>
Didn't work.

I tried the normal PHP if:
if ($memprofile['uid'] == 2) {
    echo "show this";
But didn't work either.
Does anyone know a way that works?

In order to use conditionals in templates, you need to install the Template Conditionals plugin.
Oh thank you!
I didn't know was needed a plugin, it works now.