Jump to:

22979 Posts in 11815 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » TinyMCE and Template plugin : themes/myTheme/css/editor.css isn't load !

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1344 Views
  • Myrdhin
    Avatar
    Community Member
    67 Posts

    TinyMCE and Template plugin : themes/myTheme/css/editor.css isn't load ! Link to this post

    Hello,

    I use Silverstripe 2.3.7 (i know : i will upgrade ) but i think this problem is in the last release too.

    I use TinyMCE Template plugin but when i select a template, his preview isn't good : my editor.css isn't load. In firebug, i can see this error :

    I think it's because a space (%20) is added !

    I solved my problem by modifying the file jsparty/tiny_mce2/plugins/template/js/template.js, in "loadCSSFiles" function, line 49. I remove spaces before and after the string.

    Before :

    loadCSSFiles : function(d) {
        var ed = tinyMCEPopup.editor;

        tinymce.each(ed.getParam("content_css", '').split(','), function(u) {
          d.write('<link href="' + ed.documentBaseURI.toAbsolute(u) + '" rel="stylesheet" type="text/css" />');
        });
    },

    After :

    loadCSSFiles : function(d) {
        var ed = tinyMCEPopup.editor;

        tinymce.each(ed.getParam("content_css", '').split(','), function(u) {
          u = u.replace(/^\s+/g,'').replace(/\s+$/g,'');
          d.write('<link href="' + ed.documentBaseURI.toAbsolute(u) + '" rel="stylesheet" type="text/css" />');
        });
    },

    Hope this help somebody

  • Bereusei
    Avatar
    Community Member
    94 Posts

    Re: TinyMCE and Template plugin : themes/myTheme/css/editor.css isn't load ! Link to this post

    Did you try to remove the spaces around the +´s?

    Before:
    d.write('<link href="' + ed.documentBaseURI.toAbsolute(u) + '" rel="stylesheet" type="text/css" />');

    After:
    d.write('<link href="'+ed.documentBaseURI.toAbsolute(u)+'" rel="stylesheet" type="text/css" />');

    I think this is the place where the spaces are embed.

    1344 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.