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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

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


Go to End


2 Posts   2948 Views

Avatar
Myrdhin

Community Member, 70 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, 96 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.