summaryrefslogtreecommitdiffstats
path: root/core/themes/classy/templates/content/media.html.twig
blob: 6728367c0be2cd9ce98954a4599e91b06c41d3e2 (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
28
29
30
31
32
{#
/**
 * @file
 * Theme override to display a media item.
 *
 * Available variables:
 * - name: Name of the media.
 * - content: Media content.
 *
 * Note that we print {{ title_suffix }} even though the title is not included.
 * This is intentional, once contextual links are embedded in the "title_suffix"
 * variable. See #2775131 for more information on the background about this.
 *
 * @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) }}>
  {{ title_suffix }}
  {% if content %}
    {{ content }}
  {% endif %}
</article>