Version 1
[yaffs-website] / web / core / themes / stable / templates / field / responsive-image-formatter.html.twig
diff --git a/web/core/themes/stable/templates/field/responsive-image-formatter.html.twig b/web/core/themes/stable/templates/field/responsive-image-formatter.html.twig
new file mode 100644 (file)
index 0000000..3f30260
--- /dev/null
@@ -0,0 +1,17 @@
+{#
+/**
+ * @file
+ * Theme override to display a formatted responsive image field.
+ *
+ * Available variables:
+ * - responsive_image: A collection of responsive image data.
+ * - url: An optional URL the image can be linked to.
+ *
+ * @see template_preprocess_responsive_image_formatter()
+ */
+#}
+{% if url %}
+  <a href="{{ url }}">{{ responsive_image }}</a>
+{% else %}
+  {{ responsive_image }}
+{% endif %}