Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

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

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


Reply


2 Posts   1585 Views

Avatar
Myrdhin

Community Member, 67 Posts

7 May 2011 at 2:45am

Hello,

I use Silverstripe 2.3.7 (i know : i will upgrade :p) 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 :

http://www.domain.tld/%20themes/myTheme/css/editor.css 404 Not Found

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 :)

Avatar
Bereusei

Community Member, 94 Posts

7 May 2011 at 7:07pm

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.