mardi 22 mars 2016

How to use IF statement in twig for given use case

I am using twig for templating

{{ content.field_votre_type_the_profil[0] }} returns "test string"

so when i compare it in if statement it not working... for example

{% if content.field_votre_type_the_profil[0] == "test string" %}
    <p>Hey i found the string</p>
{% endif %}

I am not getting the "Hey i found the string" in output..

Any idea?

Aucun commentaire:

Enregistrer un commentaire