Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CKEditor 5 inline media image support #78

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions templates/media/media--image.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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 <img> tag.
* ~~ Renders field_aria_description inside div#description-[MID].sr-only.
Expand All @@ -13,7 +15,7 @@
*/
#}
{{ title_suffix.contextual_links }}
{% if content %}
<div{{ attributes }}>

{% if media.field_aria_description.0.value -%}
{% if media.field_media_image.0.value -%}
Expand All @@ -38,4 +40,4 @@
{{ content }}
{%- endif %}

{% endif %}
</div>
11 changes: 6 additions & 5 deletions templates/media/media.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
/**
* @file
* Theme override to display a media item.
* ~ Removed <div{{ attributes }}> 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
Expand Down Expand Up @@ -32,7 +33,7 @@
* @ingroup themeable
*/
#}
{{ title_suffix.contextual_links }}
{% if content %}
{{ content }}
{% endif %}
{{ title_suffix.contextual_links }}
<div{{ attributes }}>
{{ content }}
</div>