{# /** * @file * Default theme implementation to display a formatted blazy image/media field. * * The Blazy supports core image, responsive image and media entity. * If iframe switcher is enabled, audio/video iframe will be hidden below image * overlay, and only visible when toggled. Otherwise iframe only, and image is * emptied. * * Available variables: * - image: A collection of image data. * - attributes: An array of attributes applied to .media container. * - iframe_attributes: An array of iframe attributes, including iframe SRC. * - settings: An array containing the given settings. * - url: An optional URL the image can be linked to, can be any of * audio/video, or entity URLs, when using Colorbox/Photobox, or Link to * content options. * - url_attributes: An array of URL attributes, lightbox or content links. * * @see template_preprocess_blazy() * * @ingroup themeable */ #} {% set classes = [ 'media', settings.namespace ? 'media--' ~ settings.namespace, settings.lazy ? 'media--loading', settings.media_switch ? 'media--switch media--switch--' ~ settings.media_switch|clean_class, settings.player ? 'media--player', settings.ratio ? 'media--ratio media--ratio--' ~ settings.ratio, settings.responsive_image_style_id ? 'media--responsive', settings.type ? 'media--' ~ settings.type, ] %} {% set iframe_classes = [ 'media__iframe', settings.ratio ? 'media__element' ] %} {% set player %} {% if settings.player %} {% block blazy_player %} {% if settings.media_switch %} {% endif %} {% endblock %} {% endif %} {% endset %} {% set media %} {% block blazy_media %} {{ image }} {{ player }} {{ settings.icon }} {% endblock %} {% endset %} {% set blazy %} {% block blazy_content %} {% if media_attributes %}{% endif %} {% if url and not settings.player %} {{ media }} {# Allows fieldable captions with A tag, such as social share. #} {% if captions and captions.lightbox is not empty %}
{{- captions.lightbox -}}
{% endif %} {% else %} {{- media -}} {% endif %} {% if media_attributes %}{% endif %} {% endblock %} {% if captions and captions.inline is defined %} {% block blazy_caption %} {% for caption in captions.inline %} {% if caption.content %} <{{ caption.tag }} {{ caption.attributes }}>{{ caption.content }} {% endif %} {% endfor %} {% endblock %} {% endif %} {% endset %} {% if wrapper_attributes %} {{ blazy }} {% else %} {{ blazy }} {% endif %}