Score:0

CKEditor5 Medialibrary insert add custom classes

gr flag

For my text-format i have "drupal media insert" in my toolbar, when choosing an image to insert there are options to align the image, i.e "align left break text" it will add a data-align attribute and in the frontend add a class ".align-left"

Is there a way to add further classes to the figure element without patching the core files?

Right now I am using a behaviour for that, but that feels like a weird ducktape

e.g

$(once('setLegacyImageAlignClasses', 'figure.align-left', context)).addClass('embedded-entity content-image content-image--medium pullout pullout--left');

what would be the correct way to add further custom classes? (D10.1, ckeditor5)

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.