media.html.twig 642 Bytes
Newer Older
1 2 3 4 5 6
{#
/**
 * @file
 * Theme override to display a media item.
 *
 * Available variables:
7 8
 * - media: The media item, with limited access to object properties and
 *   methods.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
 * - 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,
  ]
%}
<div{{ attributes.addClass(classes) }}>
  {{ title_suffix.contextual_links }}
  {% if content %}
    {{ content }}
  {% endif %}
</div>