Forum

Thread tagged as: TinyMCE, Redactor, CKEditor

Center aligning images in blog posts

Hello,

A client of mine has come back with a question that has left me a little surprised because it has been left out of all of the editors. Has anyone found a way, in either of the editors to allow a client to center align an image?

From what I can see Blocks is a fantastic, albeit different workaround but it's my last resort because the client wouldn't be completely familiar with the layout.

Chima Nwosu

Chima Nwosu 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Normally you'd do that my applying a class to the image. I think most of the editors allow for it. With MarkItUp you can use the imageclasses attribute.

Ahh thanks for this Drew, I'll have a look a go at this now

So i've tried this and although it gives me precisely what I need (only works with markitup), it comes with a lot less styling options than I'd hoped for. Is there a way I can add extra styles to markitup?

Hi Chima

For images, you can have as many different classes as you like to apply different styles:

<perch:content id="body" type="textarea" label="Article body" markdown="true" editor="markitup" imagewidth="300" imageheight="200" imageclasses="left,right,center,huge,another" />

If you are looking to add new options for the editor to use in Markitup it is fairly straightfoward to make changes, this post might be useful:

https://forum.grabaperch.com/forum/09-07-2015-remove-the-ability-to-add-images-in-the-markitup-editor

ahh thanks Mike, that post is what was looking for