开发者

Changing url depth vs TinyMCE image insert

开发者 https://www.devze.com 2023-03-08 15:58 出处:网络
I\'ve written a plugin that allows users to add images to TinyMCE, which works.The problem is that the saved html when displayed may vary depth in the URL - e.g. mysite.com/path/path/path/page.htm whi

I've written a plugin that allows users to add images to TinyMCE, which works. The problem is that the saved html when displayed may vary depth in the URL - e.g. mysite.com/path/path/path/page.htm which would render any image links br开发者_Go百科oken as the path depth changes. I don't want to use absolute paths, is there a good approach to fixing this?


If you don't want to use absolute paths you can configure tinymce using the init and the following

relative_urls : true,
document_base_url : "http://www.mysite.com/path_x/",

This will convert all URLs within the same domain to relative URLs. The URLs will be relative from the document_base_url. You may define the base URL as short as needed.

Here is a link to the possible tinymce settings concerning paths.

0

精彩评论

暂无评论...
验证码 换一张
取 消