twig if else
snippet in php

twig if else

user6119

// twig if else
{% if process_1 %}
   {{ process_1 }}
{% elseif process_2 %}
   Only {{ process_2 }} left!
{% else %}
   Sold-out!
{% endif %}

if else twig

user8430

{% if product.stock > 10 %}
   Available
{% elseif product.stock > 0 %}
   Only {{ product.stock }} left!
{% else %}
   Sold-out!
{% endif %}
 

twig if statement

user1085

{% if users %}
    <ul>
        {% for user in users %}
            <li>{{ user.username|e }}</li>
        {% endfor %}
    </ul>
{% endif %}

twig if

user4693

{% if online == false %}
    <p>Our website is in maintenance mode. Please, come back later.</p>
{% endif %}

twig if statement

user9211

{% if online == false %}
    <p>Our website is in maintenance mode. Please, come back later.</p>
{% endif %}

twig if

user1789

{% if not user.subscribed %}
    <p>You are not subscribed to our mailing list.</p>
{% endif %}