Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get TinyMCE to use full image url instead of relative one

Tags:

url

tinymce

I use TinyMCE as editor on a website. Problem is, when I insert images from the same site, TinyMCE will use relative url to the image instead of the fixed url I entered when including the image.

The resulting html is used elsewhere, for example in emails. Problem is, relative urls will not show up properly anywhere but in the original location.

How do I get TinyMCE to use full absolute urls instead of shortened relative ones?

like image 218
Sam Avatar asked Sep 26 '10 07:09

Sam


2 Answers

Make sure in the javascript initialization you are using, that you have these lines in it:

relative_urls : false, remove_script_host : false, convert_urls : true, 

Read more: TinyMCE - URL handling options

like image 90
Randy the Dev Avatar answered Oct 10 '22 04:10

Randy the Dev


As it was previously pointed out, this the correct way:

relative_urls : false, remove_script_host : false, convert_urls : true, 

HOWEVER, there is one thing to mention that will make you wonder why it's not working even though you have specified the proper text above. Ensure the false and true do NOT have quotes around them.

The following is incorrect:

relative_urls : "false",  
like image 24
Alan Fullmer Avatar answered Oct 10 '22 05:10

Alan Fullmer