How do I align images to the right in CKEditor 5?

Here is an image of how it was done in our recent Drupal 7 site. It was very similar in CKEditor 4 for BackdropCMS. But, I'm not finding this align right option in CKEditor 5.

(Screenshot is how we did it in Drupal 7 site)

 

 

Accepted answer

Out of the box: click on the image, then use the balloon toolbar to select alignment:

You can also click the Pencil icon to open the image dialog, where the alignment options are also available:

However, there are caveats:

  • On the text format, the "Float images left and right using the data-align attribute" filter must be enabled on the format.

  • Also, unlike CKEditor 4, the alignment buttons in the regular toolbar do not float images, they only apply to text paragraphs now. Only the balloon toolbar (and the dialog) contain the alignment options in CKEditor 5.

Comments

indigoxela's picture

You seem to be using IMCE, is that correct? A little bit more info about your setup would be helpful, though. Your screenshot looks like it's from Drupal 7 ...

Alignment in CKE5 happens via image library dialog (same as with CKE4).

Dialog screenshot

If you're not using that dialog (from Backdrop core, with image plugin), you don't have access to alignment via UI, as CKE5 doesn't provide that.

However, there's a different (and easy) option: TinyMCE with the TinyMCE IMCE integration plugin:

https://backdropcms.org/project/tinymce_imce

P.S.: If you struggle to get something working with CKE, try TinyMCE.

quicksketch's picture

Out of the box: click on the image, then use the balloon toolbar to select alignment:

You can also click the Pencil icon to open the image dialog, where the alignment options are also available:

However, there are caveats:

  • On the text format, the "Float images left and right using the data-align attribute" filter must be enabled on the format.

  • Also, unlike CKEditor 4, the alignment buttons in the regular toolbar do not float images, they only apply to text paragraphs now. Only the balloon toolbar (and the dialog) contain the alignment options in CKEditor 5.

@indigoxela and @quicksketch - Thank you. 

This was the part I was missing. I was not getting the alignment options in the balloon toolbar, because I had not enabled the Float Images filter in the text format.

I got it now!