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.
精彩评论