vte:if

attributes:
test [{var1}|integer|'string'|"string"|true|false] [=|!=|<|>|in] [{var2}|integer|'string'|"string"|true|false]|[{var}]|[!{var}]
children:
vte:else (optional)

Code inside vte:if is evaluated/printed if test condition is satisfied.

Required attribute is test.

vte:if tag can be parent of vte:else.

Example #1:

<vte:if test="{var}">
    Var is evaluated as not empty (PHP treats boolean true, array with elements, 
    strings other than '', numbers other than 0, ... as not empty)
</vte:if>

Example #2:

<vte:if test="!{var}">
    Var is evaluated as empty (PHP treats boolean false, array without elements, 
    string '', number 0, ... as empty), thus this message is printed.
</vte:if>

Example #3:

<vte:if test="1 &lt; 2">
    1 is smaller than 2.
    <vte:else>
        1 is larger or equal than 2.
    </vte:else>
</vte:if>

Example #4:

<vte:if test="2 in {array}">
    2 is a member of array.
</vte:if>

Example #5:

<vte:if test="{tag.name} != ''">
    <li>
        <a href="{tag.get_href}">
            <span style="font-size:{tag.get_fontsize}px;">
                <vte:value select="{tag.name}" />
            </span>
        </a>
    </li>
</vte:if>