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