You are here

webform-element-audio-file.html.twig in Webform 6.x

Same filename and directory in other branches
  1. 8.5 templates/webform-element-audio-file.html.twig

Default theme implementation for an audio file element.

Available variables:

  • element: The element.
  • value: The element's value.
  • options Associative array of options for element.
  • file: The element's File object.
  • file_link: Link to the file.

File

templates/webform-element-audio-file.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for an audio file element.
  5. *
  6. * Available variables:
  7. * - element: The element.
  8. * - value: The element's value.
  9. * - options Associative array of options for element.
  10. * - file: The element's File object.
  11. * - file_link: Link to the file.
  12. *
  13. * @see http://caniuse.com/#feat=audio
  14. * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio
  15. */
  16. #}
  17. {% if extension == 'mp3' %}
  18. <div class="webform-audio-file">
  19. <audio controls>
  20. <source src="{{ uri }}" type="{{ type }}">
  21. </audio>
  22. </div>
  23. {% endif %}
  24. <div>{{ file_link }}</div>