Skip to content
Twig Field Finder
Theme

Image — public URL / image style

Fill in your field name

Italic values are placeholders: replace them with your own machine names, or let the builder do it.

Reads the entity directly, before field formatters run.

  1. Twig
    {{ file_url(node.field_name.entity.uri.value) }}

Reads the content render array, after field formatters run.

  1. Twig
    {{ file_url(content.field_name['#items'].entity.uri.value) }}

Uses a contrib module’s Twig filter or function.

  1. {{ bamboo_render_image_style(node.field_name.entity.field_media_image.entity.uri.value, 'page_header') }}
  2. {{ node.field_name.entity.uri.value|image_style('thumbnail') }}

Gotcha

The bamboo example assumes a media reference field whose media has field_media_image.

Contrib modules used

See helper modules for what each one provides.