Simplified Twig template variables for Drupal
Simplified Twig template variables for Drupal.
Examples:
{{ _article.title }}
{{ _artile.body.value }}
or {{ artile.body.summary }}
for the summary.{{ _article.field_link.url }}
<img src="{{ _article.field_image.url }} alt="{{ _article.field_image.alt }}" />
{{ _article.field_author.field_name }}
The value module also ships with some helpful Twig filters.
{{ _article.field_image.uri|image_style('thumbnail') }}
{{ _article.body|markup }}
for rendering safe HTML markup.{{ _article.title|truncate(10) }}
will truncate title to 10 characters.{{ _article.title|words(5) }}
will truncate title to 5 words.{{ _article|pick(['field_name', 'field_author']) }}
to pick some values only.{{ _article|rename_keys(field_title: 'title') }}
to rename keys.Create an issue in the issue queue.