Template Else-If and Else Statements
Pre-release
Pre-release
Now, you can add more conditionals to templates by using {% elseif(condition) %}
and/or {% else %}
. Below are some examples:
<p>If statements (using {\% if %}):</p>
<p>If, else if, else if, else</p>
{% if statement == 0 %}
<p>if: 0 (real {{statement}})</p>
{% elseif(statement == 1) %}
<p>elseif: 1 (real {{statement}})</p>
{% elseif (statement == 2) %}
<p>elseif: 2 (real {{statement}})</p>
{% else %}
<p>else: {{ statement }}</p>
{% endif %}
-------------------------------
<p>If, else</p>
{% if statement4 == 0 %}
<p>if: 0 (real {{statement4}})</p>
{% else %}
<p>else: {{ statement4 }}</p>
{% endif %}
-------------------------------
<p>If, else if</p>
{% if statement6 == 8 %}
<p>if: 8 (real {{statement6}})</p>
{% elseif(statement6 == 7) %}
<p>elseif: 7 (real {{statement6}})</p>
{% endif %}