Some Twig convenience methods for Drupal 9

Twig_tweak cheatsheet (highly recommend): https://git.drupalcode.org/project/twig_tweak/-/blob/3.x/docs/cheat-sheet.md

  {{ node.field_image_hero | file_url }}
 content.field_background_color|escape|striptags|replace({"\n": "", "\r": "", "\t": ""})
 {% for item in items %}
   {{ item.content['#context']['value'] }}
 file_url(content.field_image['#items'].entity.uri.value)
Please login or register to post a comment.