You are here

file-link.html.twig in Drupal 10

Default theme implementation for a link to a file.

Available variables:

  • attributes: The HTML attributes for the containing element.
  • link: A link to the file.
  • file_size: The size of the file.

File

core/modules/file/templates/file-link.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation 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. * - file_size: The size of the file.
  10. *
  11. * @see template_preprocess_file_link()
  12. *
  13. * @ingroup themeable
  14. */
  15. #}
  16. <span{{ attributes }}>{{ link }}</span>
  17. {% if file_size %}
  18. <span>({{ file_size }})</span>
  19. {% endif %}

Related topics