You are here

youtube-thumbnail.html.twig in YouTube Field 8

Default theme implementation to display an embedded YouTube video.

Available variables:

  • video_id: The ID of the YouTube video. Used to construct the iframe's src.
  • entity_title: The title of the entity with the YouTube video field value.
  • image_style: The image style to render the image through, if selected in the field's display settings.
  • image_link: The link object for where the image should be linked to, if selected in the field's display settings.
  • image: An image render array. If an image_link was passed, a rendered link is wrapped around the image. The image has the following attributes:

    • src: The URL of the local image. This image is downloaded when the thumbnail display is first rendered. If the image is to be rendered through an image style, this URL will reflect that.
    • alt: Alternate text based on the title of the entity with this field.

File

templates/youtube-thumbnail.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display an embedded YouTube video.
  5. *
  6. * Available variables:
  7. * - video_id: The ID of the YouTube video. Used to construct the iframe's src.
  8. * - entity_title: The title of the entity with the YouTube video field value.
  9. * - image_style: The image style to render the image through, if selected in
  10. * the field's display settings.
  11. * - image_link: The link object for where the image should be linked to, if
  12. * selected in the field's display settings.
  13. * - image: An image render array. If an image_link was passed, a rendered link
  14. * is wrapped around the image. The image has the following attributes:
  15. * - src: The URL of the local image. This image is downloaded when the
  16. * thumbnail display is first rendered. If the image is to be rendered
  17. * through an image style, this URL will reflect that.
  18. * - alt: Alternate text based on the title of the entity with this field.
  19. *
  20. * @see template_preprocess_youtube_thumbnail()
  21. *
  22. * @ingroup themeable
  23. */
  24. #}
  25. {{ image }}