file-link.html.twig
Same filename in this branch
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.
See also
template_preprocess_file_link()
3 theme calls to file-link.html.twig
- GenericFileFormatter::viewElements in core/
modules/ file/ src/ Plugin/ Field/ FieldFormatter/ GenericFileFormatter.php - Builds a renderable array for a field value.
- ManagedFile::processManagedFile in core/
modules/ file/ src/ Element/ ManagedFile.php - Render API callback: Expands the managed_file element type.
- TableFormatter::viewElements in core/
modules/ file/ src/ Plugin/ Field/ FieldFormatter/ TableFormatter.php - Builds a renderable array for a field value.
File
-
core/
themes/ claro/ templates/ field/ file-link.html.twig
View source
- {#
- /**
- * @file
- * 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.
- *
- * @see template_preprocess_file_link()
- */
- #}
- {{ attach_library('claro/classy.file') }}
- <span{{ attributes }}>{{ link }} <span class="file__size">({{ file_size }})</span></span>