• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Setting a TRUE and FALSE Value

#1
Code for dummies! ;)

I'm trying to get this peice of code to work but cant get the template to save without an error.

I wish to set a NEW value to TRUE and use in a <xen:if> This is what i got...

<xen:set var="$myvar">true</xen:set>
<xen:if {$myvar}="true">
This is true!
<xen:else />
This is False!
<xen:if>

Something so simple but can't understand why.
 
#5
<xen:set var="$myvar">1</xen:set>
<xen:if {$myvar}="1">
This is true!
<xen:else />
This is False!
<xen:if>

Still cant get it to save. Any iears
 

Mike

XenForo developer
Staff member
#6
I was assuming that was pseudocode, as the <xen:if> is syntatically wrong. This will suffice:

<xen:if is="{$myvar}">
 
#7
Oh lovely jubbley, thankyou so much mike.

final code if anyone else wants it

1 = True
0 = False

<xen:set var="$myvar">1</xen:set>
<xen:if is="{$myvar}">
This is True
<xen:else />
This is Fause
</xen:if>

Nice one :)