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.
See also
1 theme call to youtube-thumbnail.html.twig
- YouTubeThumbFormatter::viewElements in src/
Plugin/ Field/ FieldFormatter/ YouTubeThumbFormatter.php - Builds a renderable array for a field value.
File
templates/youtube-thumbnail.html.twigView source
- {#
- /**
- * @file
- * 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.
- *
- * @see template_preprocess_youtube_thumbnail()
- *
- * @ingroup themeable
- */
- #}
- {{ image }}