You are here

file-link.html.twig in Drupal 10

Theme override for a link to a file.

Available variables:

  • attributes: The HTML attributes for the containing element.
  • link: A link to the file.
  • icon: The icon image representing the file type. This seems to be always empty.
  • file_size: The size of the file.

File

core/themes/claro/templates/field/file-link.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for a link to a file.
  5. *
  6. * Available variables:
  7. * - attributes: The HTML attributes for the containing element.
  8. * - link: A link to the file.
  9. * - icon: The icon image representing the file type. This seems to be always
  10. * empty.
  11. * - file_size: The size of the file.
  12. *
  13. * @see template_preprocess_file_link()
  14. */
  15. #}
  16. {{ attach_library('claro/classy.file') }}
  17. <span{{ attributes }}>{{ link }} <span class="file__size">({{ file_size }})</span></span>