file-link.html.twig in Drupal 8
Same filename in this branch
- 8 core/modules/file/templates/file-link.html.twig
- 8 core/themes/classy/templates/field/file-link.html.twig
- 8 core/themes/claro/templates/field/file-link.html.twig
- 8 core/themes/stable/templates/field/file-link.html.twig
- 8 core/themes/seven/templates/classy/field/file-link.html.twig
- 8 core/themes/bartik/templates/classy/field/file-link.html.twig
- 8 core/profiles/demo_umami/themes/umami/templates/classy/field/file-link.html.twig
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.
- file_size: The size of the file.
4 theme calls to file-link.html.twig
- FileFieldDisplayTest::testNodeDisplay in core/
modules/ file/ tests/ src/ Functional/ FileFieldDisplayTest.php - Tests normal formatter display on node display.
- 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/profiles/demo_umami/themes/umami/templates/classy/field/file-link.html.twigView 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.
- * - file_size: The size of the file.
- *
- * @see template_preprocess_file_link()
- * @see stable_preprocess_image_widget()
- */
- #}
- {{ attach_library('umami/classy.file') }}
- <span{{ attributes }}>{{ icon }} {{ link }}</span>