I need absolute image URLs on one of the sites I manage. I tried setting the relative_urls, change_urls and remove_script_host variables in /config/tinyMceConfig.xml, but none of the settings seem to have any effect on the richtext editor behaviour. I debugged tiny_mce_src.js, because that is included in Umbraco and apparently that decides it must generate relative URLs.
This below code decides that I want relative URLs even though the config says otherwise:
part of tiny_mce_src.js with my ugly hack to circumvent relative URL creation:
convertURL : function(u, n, e) {
var t = this, s = t.settings;
// Use callback instead if (s.urlconverter_callback) return t.execCallback('urlconverter_callback', u, e, true, n);
// Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs if (!s.convert_urls || (e && e.nodeName == 'LINK') || u.indexOf('file:') === 0) return u;
// Convert to relative
// THIS IS A HACK TO CIRCUMVENT RELATIVE URL CREATION: s.relative_urls = false; if (s.relative_urls) return t.documentBaseURI.toRelative(u);
// Convert to absolute u = t.documentBaseURI.toAbsolute(u, s.remove_script_host); return u;
},
Why is s.relative_urls "true" even when I put relative_urls = false in the config and even when I change relative_urls: 0 in tiny_mce_src.js?
If you haven't tried this yet, I would suggest to edit your web.config file and save it, just to make sur that the project is fully reloaded. I had to do this to make changes in tinyMceConfig.xml effective.
TinyMce config file changes don't work
Hello,
I need absolute image URLs on one of the sites I manage. I tried setting the relative_urls, change_urls and remove_script_host variables in /config/tinyMceConfig.xml, but none of the settings seem to have any effect on the richtext editor behaviour. I debugged tiny_mce_src.js, because that is included in Umbraco and apparently that decides it must generate relative URLs.
This below code decides that I want relative URLs even though the config says otherwise:
from the config:
<config key="relative_urls">false</config>
<config key="convert_urls">true</config>
part of tiny_mce_src.js with my ugly hack to circumvent relative URL creation:
convertURL : function(u, n, e) {
var t = this, s = t.settings;
// Use callback instead
if (s.urlconverter_callback)
return t.execCallback('urlconverter_callback', u, e, true, n);
// Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs
if (!s.convert_urls || (e && e.nodeName == 'LINK') || u.indexOf('file:') === 0)
return u;
// Convert to relative
// THIS IS A HACK TO CIRCUMVENT RELATIVE URL CREATION:
s.relative_urls = false;
if (s.relative_urls)
return t.documentBaseURI.toRelative(u);
// Convert to absolute
u = t.documentBaseURI.toAbsolute(u, s.remove_script_host);
return u;
},
Why is s.relative_urls "true" even when I put relative_urls = false in the config and even when I change relative_urls: 0 in tiny_mce_src.js?
Hello,
If you haven't tried this yet, I would suggest to edit your web.config file and save it, just to make sur that the project is fully reloaded. I had to do this to make changes in tinyMceConfig.xml effective.
is working on a reply...