Skip to main content
deleted 1 character in body
Source Link
Berdir
  • 83.7k
  • 6
  • 163
  • 209

The easiest way to avoid the standard field divs is to only print out the first delta. That works well for single-value fields, morefor 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.

The easiest way to avoid the standard field divs is to only print out the first delta. That works well for single-value fields, more 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.

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.

Source Link
Berdir
  • 83.7k
  • 6
  • 163
  • 209

The easiest way to avoid the standard field divs is to only print out the first delta. That works well for single-value fields, more 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.