From 467d75397ea5a0baca949dd09ad51f2a368cf88c Mon Sep 17 00:00:00 2001
From: ebremner <ebremner@uwaterloo.ca>
Date: Thu, 22 Apr 2021 15:31:40 -0400
Subject: [PATCH] ISTWCMS-4773: updating media image to add all classes, mainly
 alignment

---
 templates/content/media.html.twig | 72 +++++++++++++++++--------------
 1 file changed, 40 insertions(+), 32 deletions(-)

diff --git a/templates/content/media.html.twig b/templates/content/media.html.twig
index 4934a7b5..83ee367e 100644
--- a/templates/content/media.html.twig
+++ b/templates/content/media.html.twig
@@ -1,32 +1,40 @@
-{#
-/**
- * @file
- * Theme override to display a media item.
- *
- * Available variables:
- * - name: Name of the media.
- * - content: Media content.
- *
- * @see template_preprocess_media()
- *
- * @ingroup themeable
- */
-#}
-{%
-  set classes = [
-  'media',
-  'media--type-' ~ media.bundle()|clean_class,
-  not media.isPublished() ? 'media--unpublished',
-  view_mode ? 'media--view-mode-' ~ view_mode|clean_class,
-]
-%}
-
-{% embed '@layouts/media/media.twig' with {
-  'classes': classes
-}%}
-
-  {% block content %}
-    {{ content }}
-  {% endblock %}
-
-{% endembed %}
+{#
+/**
+ * @file
+ * Theme override to display a media item.
+ *
+ * Available variables:
+ * - name: Name of the media.
+ * - content: Media content.
+ *
+ * @see template_preprocess_media()
+ *
+ * @ingroup themeable
+ */
+#}
+{%
+  set classes = [
+  'media',
+  'media--type-' ~ media.bundle()|clean_class,
+  not media.isPublished() ? 'media--unpublished',
+  view_mode ? 'media--view-mode-' ~ view_mode|clean_class,
+]
+%}
+
+{% set modifier_classes = '' %}
+
+{% set classes = classes | merge(attributes.class) %}
+
+{% for class in classes %}
+ {% set modifier_classes = modifier_classes ~ ' ' ~ class %}
+{% endfor %}
+
+{% embed '@layouts/media/media.twig' with {
+  'modifier_classes': modifier_classes
+}%}
+
+  {% block content %}
+    {{ content }}
+  {% endblock %}
+
+{% endembed %}
-- 
GitLab