elseif


Located withinend of an if loop, else tags display a template block when the condition returns false. There can be multiple elseif tags within an if tag.


Syntax


{% if <Conditions> %}

<Template Block>

{% elseif <Conditions> %}

<Template Block>

{% endif %}



Example:

InputParameter Value


6



Input


I like {% if InputParameter < 1 %}

no

{% elseif InputParameter == 1 %}

one animal

{% elseif InputParameter > 1 and InputParameter <= 4 %}

a couple animals

{% elseif InputParameter > 4 and InputParameter <= 6 %}

a handful of different animals

{% elseif InputParameter > 6 and InputParameter <= 9 %}

several animals

{% else %}

a lot of animals

{% endif %}!



Output


I like a handful of different animals!