"Digging Deeper" with Twig I created a custom twig file that outputs a few basic fields, such as images and text. Here's what my twig file looks like:

&lt;div class="image"&gt;
    {{content.field_image}}
&lt;/div&gt;

&lt;div class="year"&gt;
    {{content.field_year}}
&lt;/div&gt;

&lt;div class="heading-text"&gt;
    &lt;h3&gt;{{content.field_heading_text}}&lt;/h3&gt;
&lt;/div&gt;


I'm trying to have a little more control of the HTML that gets output. Here's what I'm seeing for a few of these fields:




I want to either, A, get rid of the div element that outputs "1963" or "Imagining a better world" or, B, get control over the div element so I can add a class to it and later style it.

Thank you in advance!
The easiest way to avoid the standard field divs is to only print out the first delta. That works well for single-value fields, for multiple, you'd need to loop over it yourself.

So, just do this: {{ content.field_year.0 }} and it will only print out the actual field content, without the wrapping field type. Might not work for every formatter, depending on what they do, but it should work for most of them.