I'm trying to access the functionality of the file-link.html.twig template that comes with the classy theme so that I can have the file-type icons automatically appear next to the file links.
I've tried using the file_url
and link
functions in twig, but with no success.
Here's an example of what my file_url looks like {{ file_url(node.field_agenda_files_upload.entity.uri.value) }}
This just outputs something like /sites/default/files/2020-07/file.pdf
I'm new to Drupal, so please be kind.
page.content
, the files show up with the icons. However, if I'm trying to figure out how to get the same functionality when usingfile_url(node.field_agenda_files_upload.entity.uri.value) }}
template_preprocess_file_link()
infile.module
.{{ drupal_field(...) }}
operator, which renders a complete field template. See cheat sheet