Skip to content

Instantly share code, notes, and snippets.

View StevenGFX's full-sized avatar
🚀
Knocking it out of the planet! 🌎

Steven Williams StevenGFX

🚀
Knocking it out of the planet! 🌎
View GitHub Profile
@StevenGFX
StevenGFX / node.twig.html
Last active November 27, 2018 22:45 — forked from leahtard/node.twig.html
Get file url in node for Drupal 8 twig template #drupal8 #twig
{# Get URL of single file field #}
{{ node.field_file.entity.uri.value }}
{# Get URL of multi file field #}
{{ node.field_file['#items'].entity.uri.value }}
{# Trun into link #}
{{ file_url(node.field_file.entity.uri.value) }}
{# Check if there is at least one value #}