Skip to content
Twig Field Finder
Theme

Media document — file URL

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.field_media_document.entity.uri.value) }}

Gotcha

Assumes core’s Document media type, whose source field is field_media_document.