Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem with insert/update links with tinyMCE

I have a problem with tinyMCE but only on live environment from some reason tinyMCE rewrite absolute url and only for some TLD sites, so far I'm notice that it doesn't work for .eu domains, does someone hade a same problem or know what can fix this?

like image 690
vaske Avatar asked Mar 22 '10 13:03

vaske


People also ask

How do you add a link in TinyMCE?

Add hyperlinks to content. The toolbar button and menu item called link are included in TinyMCE's default configuration. The link menu item can be found in the Insert menu. The link plugin also includes a context menu and context toolbar.

How do you get content in TinyMCE with HTML tags?

You can do this using the getContent() API method. Let's say you have initialized the editor on a textarea with id=”myTextarea”. This will return the content in the editor marked up as HTML.

How do I save HTML content of TinyMCE into a file?

Hello, To save the page, you have to insert TinyMCE in a HTML form and add a submit button. Then you'll have to handle the submitted form with a language like PHP. A call to the file_put_contents() function should do it.


3 Answers

We needed to set both of these options in order to get TinyMCE to stop rewriting URLs to relative paths.

relative_urls : 0
remove_script_host : 0
like image 99
jasonbar Avatar answered Sep 30 '22 02:09

jasonbar


Am I the only person that finds the TinyMCE relative_urls option confusing ?

If you're writing an article/blog post and want to include a ink to a web site other than one you're on, I think the term "absolute URL" describes what you want. You want to put "http://www.somesite.com" and not have TinyMCE put either a forward slash '/' or a relative path '/mysite/' in front of it.

Surprisingly, if you set the following :

tinyMCE.init({
        ...
        relative_urls : false
});

then that's exactly what TinyMCE does :(

But, if you do this :

tinyMCE.init({
        document_base_url : "http://www.somesite.com",
        relative_urls : true
});

Then you seem to get plain, unadulterated links.

Go figure.

like image 21
Grindlay Avatar answered Sep 30 '22 03:09

Grindlay


Although this question has already been answered. I have my own solution and it could be helpful to some others if the accepted answer does not work.

Please see link below for more info.

tinyMCE.init({
    ...
    convert_urls: false,
});

https://www.tiny.cloud/docs/configure/url-handling/#convert_urls

like image 37
Achmed Zuzali Avatar answered Sep 30 '22 03:09

Achmed Zuzali