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.
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 rconring - August 21, 2013
Thanks for the reply but if I could get him to click on anything I could get him to select Left and enter 10 in the hspace field. This person, as brilliant as he is, refuses to grasp the concept of positioning, no matter how simple it is! He is a phenomenon!
I found the answer and it is perfect for this situation since it can be overridden if other positioning is required.
The HTML for the image pop-up is in the file /cmsAdmin/3rdParty/tiny_mce/themes/advanced/image.htm. It is a simple matter to set the default values for whatever you want.
It is fixed!
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987
Hi Ron,
Glad you've got it working. Thanks for explaining the steps you went through to add the fix.
Cheers
Greg
PHP Programmer - interactivetools.com