drupal 7 - Add CSS class on text align -


i'd add css class or set style image when click align right, left or center in "ckeditor" in drupal 7.

what should do? can make plugin, don't know how catch text align operation add class/set style on image.

there ckeditor configurations allow use class-based alignment images , text justification paragraphs instead of using inline css added style attribute. you'll need paste "custom javascript configuration" of "advanced options" section of ckeditor profile(s) you're working in drupal admin ui:

// image alignment , text justification. config.justifyclasses = [ 'rteleft', 'rtecenter', 'rteright', 'rtejustify' ]; 

if you're ok giving old image properties dialog, enhanced image plugin ckeditor has ability use classes image alignment instead of inline css on <img> tag's style attribute, non-default configuration must added "advanced options" section hand, , you'll need provide own stylesheet else images not align in editor nor on front-end of site.

// image alignment classes enhanced image plugin. config.image2_alignclasses = [ 'align-left', 'align-center', 'align-right' ]; 

alternatively, module ckeditor image2 handles these required modifications advanced options , provides stylesheet can use out of box.

disclaimer: i'm creator , maintainer of ckeditor image2 module. feedback welcome.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -