Change theme:   

if

If is the conditional block

{% if user.admin %}
  Admin user!
{% else %}
  Not admin user
{% endif %}

There are {% if count < 5 %} less {% else %} more {% endif %} items than you need.

Some examples on how to work with different kind of conditions:

{% if user.email == empty %}
  Please enter your e-mail address
{% endif %}

{% if user.name == 'peter' and user.name != 'John' %}
  Hello you, Non-John Peter!
{% endif %}

{% if ball.count < 1 %}
  You have no balls
{% endif %}

# Check if array contains desired value, e.g. ['foo', 'bar']
{% if array contains 'foo' %}
  There is a 50/50 chance that this array also contains "bar" :)
{% endif %}

# Check if string contains desired value, e.g 'hello world'
{% if some_string contains 'hello' %}
  String contains "hello"
{% endif %}