diff --git a/templates/media/media--image.html.twig b/templates/media/media--image.html.twig index bc54833..4fc3ef8 100644 --- a/templates/media/media--image.html.twig +++ b/templates/media/media--image.html.twig @@ -2,6 +2,8 @@ /** * @file * Theme override to display an image media item with WA-compliant description. + * + * In addition to mods in cwd_base/media/media.html.twig: * ~ When field_aria_description has value, this template: * ~~ Adds aria-describedby="description-[MID]" to field_media_image tag. * ~~ Renders field_aria_description inside div#description-[MID].sr-only. @@ -13,7 +15,7 @@ */ #} {{ title_suffix.contextual_links }} -{% if content %} + {% if media.field_aria_description.0.value -%} {% if media.field_media_image.0.value -%} @@ -38,4 +40,4 @@ {{ content }} {%- endif %} -{% endif %} + diff --git a/templates/media/media.html.twig b/templates/media/media.html.twig index e655d40..7db4a02 100644 --- a/templates/media/media.html.twig +++ b/templates/media/media.html.twig @@ -2,7 +2,8 @@ /** * @file * Theme override to display a media item. - * ~ Removed wrapper (ama39) + * ~ Add div with attributes back to this template (we removed it in the past). + * ~ Remove "if content" check. * * Available variables: * - media: The media item, with limited access to object properties and @@ -32,7 +33,7 @@ * @ingroup themeable */ #} - {{ title_suffix.contextual_links }} - {% if content %} - {{ content }} - {% endif %} +{{ title_suffix.contextual_links }} + + {{ content }} +