Testing field value in twig template In my twig theme - I'm attempting to test the value of the field "field_left_image_front" - which is either "Yes" or "No"

{% if content.field_left_image_front.0 == "Yes"  %}
&lt;img class="content-image" src="{{ file_url(content.field_left_image.0['#item'].entity.uri.value) }}"&gt;
{% else %}
&lt;div class="textdescriptions" style="background-color:{{ content.field_left_hex_color.0 }}"&gt;&lt;!--start text descriptions--&gt;
&lt;div class="textdetails" style="color:white !important"&gt; &lt;!--start text details--&gt;
&lt;h1&gt;{{ content.field_left_title.0 }} {{ content.field_left_image_front.0 }}&lt;/h1&gt;
&lt;p&gt;{{ content.field_left_body }}&lt;/p&gt;
&lt;/div&gt;&lt;!--end text details--&gt;
&lt;/div&gt;
{% endif %}


A few bits of info:


field_left_image_front is a select list/list item in the CMS
I'm testing the value by outputting it in h1 tag - so I can see that it's "Yes"
Despite being "Yes", it's outpitting the text description and ignoring the image.


Is there something I'm doing wrong with the conditional?
Use node (if this is a node template) to get the field value, see Conditional statement doesn&#39;t work in node.html.twig. Another reason in this case is that Yes/No would be translatable in a multilingual site, while the field value from nodeis the untranslatable left key of a select list.

If it is not a node template look at the variables listed at the top of the template, for example paragraph.html.twig:

/**
 * @file
 * Default theme implementation to display a paragraph.
 *
 * Available variables:
 * - paragraph: Full paragraph entity.

 * - content: All paragraph items. Use {{ content }} to print them all,
 *   or print a subset such as {{ content.field_example }}. Use
 *   {{ content|without('field_example') }} to temporarily suppress the printing
 *   of a given child element.


Here the variable for the entity is paragraph and for the render array content.

So use {{ content.field_example }} to print fields and {{ paragraph.field_example.value }} to get field values from the database.