Need to set defauts for image placement in editor.

5 posts by 3 authors in: Forums > CMS Builder
Last Post: August 21, 2013   (RSS)

By rconring - August 21, 2013

Well, as much as I hate to do it, I have a need to alter the TinyMCE defaults on an installation ... specifically the image alignment defaults when an image is placed in a content editor.  The client cannot seem to grasp the concept of left aligning the images and giving a 10 pixel horizontal margin so that the text wraps even though I have showed him countless times over the years.  If I had known when I set up the section that he would want a photo and some text in this field, I could have made separate fields for image and text and controlled the layout on the front end, but it's too late now, so I have gone through all the entries and fixed them and now want to default ALL subsequent images in content editors to left justify with 10px horizontal margin.  Where would I start looking for the code that I would have to alter?  I realize it will affect all editors for all sections, but that's OK since 99% of all need left justified anyway.

Ron Conring
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987

By mizrahi - August 21, 2013

Another way to accomplish is utilize the Style Select dropdown. You can setup a special class for images that need to be floated left. Your client will just need to click on the image and then select an option from the dropdown menu. You will need to setup the proper css styles for the floating and margins. I use this a lot and it works well.

You will need to activate the "styleselect" option in the lib/wysiwyg.php file and also set the "theme_advanced_styles"

Note, the style will be applied to the paragraph that is wrapped around the image, not to the image itself. This means you'll need to float the paragraph, not just the image. 

By mizrahi - August 21, 2013

Glad to hear you found a solution.

Hi Ron,

Glad you've got it working. Thanks for explaining the steps you went through to add the fix.

Cheers

Greg

Greg Thomas







PHP Programmer - interactivetools.com