You are here

yamlform-element-audio-file.html.twig in YAML Form 8

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/yamlform-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 http://www.w3schools.com/html/html5_audio.asp
  15. */
  16. #}
  17. {% if extension == 'mp3' %}
  18. <div class="yamlform-audio-file">
  19. <audio controls>
  20. <source src="{{ uri }}" type="{{ type }}">
  21. </audio>
  22. </div>
  23. {% endif %}
  24. <div>{{ file_link }}</div>