ChristieMADE.com
  • Home
  • Portfolio
  • Blog
  • Contact
  • Menu Menu

Image Alignment Doesn’t Work in TinyMCE

by Christie
August 6, 2008

This is a problem with TinyMCE 3.0. They don’t currently have align attribute working properly, so they’ve substituted float: left; to temporarily solve this problem. “float” is applied to the image using the “style” tag, but the base install on TinyMCE does not come with the option to add style attributes to images, so you have to add it into the list of usable tags using the ‘extended_valid_elements‘ settings.

Achieving this in Drupal is easy: go to the plugin_reg.php file which is located in your TinyMCE module directory. Find the line that says

$plugins['advimage']['extended_valid_elements'] = array('img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]');

and make sure you add |style to the very end, like so:

$plugins['advimage']['extended_valid_elements'] = array('img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|style]');

If you’re using TinyMCE with any other software, I suggest doing a search for ‘extended_valid_elements’ and see if you can find where it’s being defined for ‘img‘. It probably looks very similar to this everywhere.

1 Comment
drupal, problems & solutions
drupal, Image Alignment, TinyMCE, wysiwyg
1 reply
  1. Nathan says:
    February 7, 2009 at 2:42 pm

    Hi!

    Thanks for this tip — it fixed the problem I was having.

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • great links
  • how-tos
  • problems & solutions
    • back-end
    • drupal
    • jquery
    • wordpress
  • recommendations

Tags

ajax animation apache audio captcha colorbox CSS css3 domain management drupal Elementor Enfold godaddy google hosting Hosting Configuration hosting management HTML iis JavaScript jQuery Languages Launch maintenance Mato Microsoft Word Network Solutions Pantheon Parallax php php.ini podcast recaptcha recaptcha v3 responsive scss server slideshow submenu SVG transfer Translation vimeo wordpress WPML
Search Search

Recent Comments

  • Mike Armani on Avoid GoDaddy’s Dedicated Server
  • Nathan on Image Alignment Doesn’t Work in TinyMCE

Archives

  • September 2019
  • April 2017
  • September 2011
  • May 2010
  • February 2010
  • May 2009
  • April 2009
  • February 2009
  • January 2009
  • September 2008
  • August 2008
  • July 2008
© 1999-2026 ChristieMADE.com
  • Link to X
Link to: Access denied on new server Link to: Access denied on new server Access denied on new serverLink to: A Favico Plugin for CS3! Link to: A Favico Plugin for CS3! A Favico Plugin for CS3!
Scroll to top Scroll to top Scroll to top