{"id":336,"date":"2011-05-25T12:27:24","date_gmt":"2011-05-25T22:27:24","guid":{"rendered":"http:\/\/mymonkeydo.com\/?p=336"},"modified":"2011-05-25T12:27:24","modified_gmt":"2011-05-25T22:27:24","slug":"get-tinymce-to-use-absolute-paths","status":"publish","type":"post","link":"https:\/\/mymonkeydo.com\/get-tinymce-to-use-absolute-paths\/","title":{"rendered":"Get TinyMCE to use Absolute Paths"},"content":{"rendered":"
I was working with a customized CMS which uses the TinyMCE editor. \u00a0This editor was placed in a subfolder to edit content meant for the root folder. \u00a0This meant that the images in the TinyMCE editor would show something like “..\/images\/” for the path to the images folder while the public pages would need something like “images\/”. \u00a0The problem with TinyMCE was that every time you insert an image it would show the absolute path, but when it saved, it would be a relative path.<\/p>\n
<\/p>\n
To get TinyMCE to always use absolute paths, tell it to not use relative paths! \u00a0In tinyMCE.init where you configure the editor, add the options under the “use absolute urls” comment<\/p>\n
<\/p>\n
tinyMCE.init({\n \/\/ General options\n mode : \"textareas\",\n theme : \"advanced\",\n width: \"480\",\n height: \"400\",\n\n \/\/use absolute urls\n remove_script_host : false,\n relative_urls : false\n});<\/pre>\n<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[2],"tags":[39,62],"yoast_head":"\n
Get TinyMCE to use Absolute Paths - My Monkey Do<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n