If you are planning to use TinyMCE for the HTML content of a Newsletter Module, keep in mind that any images you put in the editor will bear the relative URL by default. The relative URLs work ok when the things are to be viewed on site. However, a newsletter has to travel across the world to different inboxes. If the default settings of TinyMCE are used, the end client will see a Big ‘X’ instead of image. Because the image path is not absolute, image cannot be shown.
Here is the solutions:
You have to add three parameters in the TinyMCE’s init section which will force it to use absolute paths. These are:
1 2 3 | document_base_url : "http://domainname.com", relative_urls : false, remove_script_host : false, |
So, your code looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | tinyMCE.init({ // General options mode : "textareas", theme : "advanced", // width: "900", height: "400", editor_selector :"mceEditor", plugins : "paste, table, inlinepopups, fullscreen", theme_advanced_buttons1 : "bold,italic,underline,|,cut,copy,paste,|,forecolor, backcolor|,bullist,numlist,|,pastetext,pasteword,link,unlink,fontselect,fontsizeselect,|,image,code,|,table,fullscreen", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, skin : "o2k7", document_base_url : "http://domainname.com", relative_urls : false, remove_script_host : false, skin_variant : "silver" }); |
Just save it, refresh the page with TinyMCE and see the source, you will see that the paths have been changed. Now save the content of TinyMCE by submitting the form and you are done.