summaryrefslogtreecommitdiffstats
path: root/core/themes/classy/templates/content/media.html.twig
blob: f36975cb9a37a52fc756c68b11ab2125344586c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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>