Twig Field Value

https://www.drupal.org/project/twig_field_value

Single field value

<strong>{{ content.field_name|field_label }}</strong>: {{ content.field_name|field_value }}

Multiple field values

<strong>{{ content.field_name|field_label }}</strong>: {{ content.field_name|field_value|safe_join(', ') }}

Single field properties

<span>Text format: {{ content.field_body|field_raw('text_format') }}.</span>

Referenced entities

<img src={{ file_url(content.field_image|field_target_entity.uri.value) }} alt={{ content.field_image|field_raw('alt') }} />

Filters:

  • field_label : Returns the field label value.
  • field_value : Returns the render array of the field value(s) without the field wrappers.
  • field_raw: Returns raw field properties value(s).
  • field_target_entity: Returns the referenced entity object(s) of an entity reference field.

results matching ""

    No results matching ""