Skip to content

Instantly share code, notes, and snippets.

@gobinathm
Created February 18, 2021 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gobinathm/a5f0037d89ce588237e433493da32bc7 to your computer and use it in GitHub Desktop.
Save gobinathm/a5f0037d89ce588237e433493da32bc7 to your computer and use it in GitHub Desktop.
Drupal 8/9 - TWIG get file url in node template
{# Get Fully Qualified URL #}
{{ file_url(node.field_file.entity.uri.value) }}
{# Get URL of multi file field #}
{{ node.field_file['#items'].entity.uri.value }}
{# Get URL of single file field #}
{{ node.field_file.entity.uri.value }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment