CornellCustomDev / cwd_base

A lightweight Drupal 8+ theme, implementing Cornell Branding and standard CWD components.
1 stars 2 forks source link

Alignment of inline images in CKEditor 5 #71

Open alisonjo315 opened 12 months ago

alisonjo315 commented 12 months ago

To do:


Background

Our inline images in CKEditor 4 use a template that's specific to entity embed, which we won't need (or want) in CKEditor 5.

We have CKEditor 5 on the new VPUE site, and the in-development CLASSE site. "Out of the box," inline images don't get aligned properly when you use the image alignment thingy in CKE 5. (I don't have an example handy, because we fixed it on those two sites, and I don't have a CD Demo multidev with CKE 5 right now.)

To fix

On VPUE and CLASSE, we added new versions of media.html.twig and media--image.html.twig, adding the div with attributes back in (that was removed in the cwd_base versions of these templates).

See it in action

At the time of writing, the outcome of these ^^ template files can be seen on these demo pages: