Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • julius 107 posts 289 karma points
    Jan 14, 2013 @ 23:39
    julius
    0

    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?

  • Evelyne Schreiner 25 posts 74 karma points
    Jan 24, 2013 @ 20:19
    Evelyne Schreiner
    1

    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.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies