Twig finds if statement true whether or not field has value I have a paragraphs field that contains a sub-title which is optional. My code below still prints out the h3 tag whether or not the sub-title has any value. Any idea why this is happening as I need to hide the h3 html if there is no value, thanks.

{% block content %}
    &lt;div class="bene"&gt;
        &lt;div class="container"&gt;
            &lt;h2&gt;{{ content.field_title }}&lt;/h2&gt;
            {% if content.field_sub_title %}
            &lt;h3&gt;{{ content.field_sub_title }}&lt;/h3&gt;
            {% endif %}
            &lt;div class="row"&gt;
              {{ content.field_prod }}
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
{% endblock %}
Look at the object itself not the render array:

{% if paragraph.field_sub_title %}
  &lt;h3&gt;{{ content.field_sub_title }}&lt;/h3&gt;
{% endif %}