If you're using TinyMCE with Drupal, you may be experincing a problem where the image properties are not saving. Things like setting the alignment, spacing (vspace, hspace), or rolling your own css like the float, margin, padding, borders, etc. It looks fine when you edit the properties on the page, but after saving the page and viewing it the changes don't stick. In fact, when editing the page, the changes are also gone.
This is a known problem with some versions of the TinyMCE module. If you're experiencing a problem, give this fix a try:
- Open a command shell (In windows, ignore this step and edit the file below)
- Change to the directory sites/all/modules/tinymce -OR- the directory where you installed your tinymce module
- Edit the file plugin_reg.php (you use vi, right?)
Find the line that has this entry (line 28 in my version):
plugins['advimage']['extended_valid_elements'] = array('img[class|src|alt|title|hspace|vspace|wid th|height|align|onmouseover|onmouseout|name]');
Add "|style" to the end of the properties list, like this:
plugins['advimage']['extended_valid_elements'] = array('img[class|src|alt|title|hspace|vspace|wid th|height|align|onmouseover|onmouseout|name|style]');
Now find the line that looks like this:
$plugins['flash']['extended_valid_elements'] = array('img[class|src|alt|title|hspace|vspace|width| height|align|onmouseover|onmouseout|name|obj|param|embed]');
Now, do the same thing as above and add "|style" to the end of the properties list (line 53 on mine):
$plugins['flash']['extended_valid_elements'] = array('img[class|src|alt|title|hspace|vspace|width| height|align|onmouseover|onmouseout|name|obj|param|embed|style]');
Now, save the file and refresh the cache by going to Administer->Performance
This should fix the issue. What's happening here is you're adding the property to the configuration file to honor style attributes to images, as entered by TinyMCE. The two configuration entries that require the "style" property to be added are the "extended_valid_elements", which are in two areas.
Unfortunately, plugin updates will wipe this out. I hanker fer a hunk o cheese that this problem will be solved by the next releases of the plugin. Let's hope so.
