Hi,
I need to make it so that when the image alignment in the image properties dialog box is set to left or right, it applies a class called "align_left" or "align_right" instead of just adding the style float:left or float:right to the image's style attribute. How can I do this?
Thanks,
Eric
-
Hi Eric,
The easiest way to do that would be to ignore the Align settings within the image dialog, and instead create a custom style set that has your alignment options in it:
CKEDITOR.stylesSet.add( 'my_styles',
[
// Block Styles
{ name: 'Align Left', element: 'img', attributes: { 'class': 'align_left' } },
{ name: 'Align Right' , element: 'img', attributes: { 'class': 'align_right' } }
]); -
-
-
-
Hey Brandon - I tried this and the inline styles (and not classes) are still appearing on aligned images. I tried deleting the image and putting it back in after adjusting the settings - still no dice.
http://db.tt/uySkawtU
http://o7.no/zTEn3G
http://o7.no/wvuX1Z
Any thoughts? -
-
Hi Jon,
How are you aligning your images – using the Image Align setting within the image dialog (wrong), or the Styles menu that has your "Align Left" and "Align Right" properties (right)? -
Loading Profile...


Twitter,
Facebook, or email.

EMPLOYEE

