Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

file-audio.html.twig

Same filename in this branch
  1. 11.1.x core/profiles/demo_umami/themes/umami/templates/classy/field/file-audio.html.twig
  2. 11.1.x core/themes/starterkit_theme/templates/field/file-audio.html.twig
  3. 11.1.x core/themes/claro/templates/classy/field/file-audio.html.twig
  4. 11.1.x core/modules/file/templates/file-audio.html.twig

Theme override to display the file entity as an audio tag.

Available variables:

  • attributes: An array of HTML attributes, intended to be added to the audio tag.
  • files: And array of files to be added as sources for the audio tag. Each element is an array with the following elements:

    • file: The full file object.
    • source_attributes: An array of HTML attributes for to be added to the source tag.

File

core/themes/stable9/templates/field/file-audio.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override to display the file entity as an audio tag.
  5. *
  6. * Available variables:
  7. * - attributes: An array of HTML attributes, intended to be added to the
  8. * audio tag.
  9. * - files: And array of files to be added as sources for the audio tag. Each
  10. * element is an array with the following elements:
  11. * - file: The full file object.
  12. * - source_attributes: An array of HTML attributes for to be added to the
  13. * source tag.
  14. */
  15. #}
  16. <audio {{ attributes }}>
  17. {% for file in files %}
  18. <source {{ file.source_attributes }} />
  19. {% endfor %}
  20. </audio>

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal