Skip to content
Twig Field Finder
Theme

Media — thumbnail

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. Snippet 1
    {{ file_url(node.field_name.entity.thumbnail.entity.uri.value) }}
  2. Snippet 2
    {{ node.field_name.entity.thumbnail.alt }}

Uses a contrib module’s Twig filter or function.

  1. {{ node.field_name.entity.thumbnail.entity.uri.value|image_style('thumbnail') }}

Gotcha

Every media type has a thumbnail image field, whatever its source. For images it’s the image itself; for documents and remote videos it’s an icon or the provider’s thumbnail.

Contrib modules used

See helper modules for what each one provides.