annotate core/modules/responsive_image/templates/responsive-image.html.twig @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 {#
Chris@0 2 /**
Chris@0 3 * @file
Chris@0 4 * Default theme implementation of a responsive image.
Chris@0 5 *
Chris@0 6 * Available variables:
Chris@0 7 * - sources: The attributes of the <source> tags for this <picture> tag.
Chris@0 8 * - img_element: The controlling image, with the fallback image in srcset.
Chris@0 9 * - output_image_tag: Whether or not to output an <img> tag instead of a
Chris@0 10 * <picture> tag.
Chris@0 11 *
Chris@0 12 * @see template_preprocess()
Chris@0 13 * @see template_preprocess_responsive_image()
Chris@0 14 *
Chris@0 15 * @ingroup themeable
Chris@0 16 */
Chris@0 17 #}
Chris@0 18 {% if output_image_tag %}
Chris@0 19 {{ img_element }}
Chris@0 20 {% else %}
Chris@0 21 <picture>
Chris@0 22 {% if sources %}
Chris@0 23 {#
Chris@0 24 Internet Explorer 9 doesn't recognise source elements that are wrapped in
Chris@0 25 picture tags. See http://scottjehl.github.io/picturefill/#ie9
Chris@0 26 #}
Chris@0 27 <!--[if IE 9]><video style="display: none;"><![endif]-->
Chris@0 28 {% for source_attributes in sources %}
Chris@0 29 <source{{ source_attributes }}/>
Chris@0 30 {% endfor %}
Chris@0 31 <!--[if IE 9]></video><![endif]-->
Chris@0 32 {% endif %}
Chris@0 33 {# The controlling image, with the fallback image in srcset. #}
Chris@0 34 {{ img_element }}
Chris@0 35 </picture>
Chris@0 36 {% endif %}