summaryrefslogtreecommitdiffstats
path: root/core/themes/classy/templates/content/media.html.twig
diff options
context:
space:
mode:
Diffstat (limited to 'core/themes/classy/templates/content/media.html.twig')
-rw-r--r--core/themes/classy/templates/content/media.html.twig27
1 files changed, 27 insertions, 0 deletions
diff --git a/core/themes/classy/templates/content/media.html.twig b/core/themes/classy/templates/content/media.html.twig
new file mode 100644
index 0000000..f36975c
--- /dev/null
+++ b/core/themes/classy/templates/content/media.html.twig
@@ -0,0 +1,27 @@
+{#
+/**
+ * @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.id()|clean_class,
+ ]
+%}
+<article{{ attributes.addClass(classes) }}>
+ {% if content %}
+ {{ content }}
+ {% endif %}
+</article>