Tags Order A-Z Category Context

<sn:if>

Renders the content in the body if the value of the value attribute is "true". Otherwise, it renders the content in the tag, if any exists.

Attributes

  • boolean < required > Must be a boolean .

Valid Contexts

  • : The area where your app is displayed alone

Code

<sn:if value="false">
   Render me if true
   <sn:else>
     Render me if false
   </sn:else>
</sn:if>
<hr/>
<sn:if value="true">
   Render me if true
   <sn:else>
     Render me if false
   </sn:else>
</sn:if>
<hr>
<sn:if value="false">
  This won't render
</sn:if>
Play with this code in the sandbox
Render me if false
Render me if true