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.

Themes

Discuss SilverStripe Themes.

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

Editor.css in 2.3.4 not pulling in typography style sheet


Reply

8 Posts   2205 Views

Avatar
Sophie

9 February 2010 at 9:11am (Last edited: 9 February 2010 9:12am), Community Member, 33 Posts

I'm working on my 5th or 6th Silver Stripe site. I've never run into an issue having the text editor show my typography.css style sheet, but I am now. I'm working in 2.3.4 for the first time and no matter what I do, I cannot get the text editor to show the typography styles.

I have an editor.css and inside that I have @import "typography.css";
All of my styles in typography.css begin .typography...
My template has a div calling for the typography style.

I've tried putting the styles straight into the editor.css, upload, and flush, but no change.

Is there someplace in the scheme of things where I need to tell the tool to look for the editor.css? Is there anything different in 2.3.4?

I know I must be missing something, but I'm just not sure what!

Thanks!

Sophie

Avatar
MateuszU

9 February 2010 at 9:27am Community Member, 89 Posts

Hi Sophie,
First of all try flushing the cache of the browser. I had the same problem when running firefox, it just wouldn't notice any changes I did to css files. Then check if typography.css has proper character case. If you name it Typography.css it might not be picked up, which can be troublesome especially on Windows, as it will not let you rename from Typography to typography :)

Avatar
banal

9 February 2010 at 11:25am (Last edited: 25 March 2010 7:57pm), Community Member, 901 Posts

The editor.css doesn't get picked up by the CMS. That's a Bug in 2.3.4, 2.3.5 and 2.3.6
For the time being you can fix this by putting the following line into your mysite/_config.php

HtmlEditorConfig::get('cms')->setOption('content_css', 'cms/css/editor.css, mysite/css/editor.css');

Alter the red colored path to the path where your editor.css file is located.
After that change, everything should work as expected

Update FYI, here's the ticket related to this: http://open.silverstripe.org/ticket/4493. Seems like this was already fixed a while ago in trunk, let's hope it finds its way into a stable release soon.

Avatar
Sophie

10 February 2010 at 1:01pm Community Member, 33 Posts

Thank you both for your comments!

mateuzs, I did check my case and flushed again - to no avail. I also use Firefox and run into the same issue at times.

banal, I've added the following to mysite/_config.php :

HtmlEditorConfig::get('cms')->setOption('content_css', 'cms/css/editor.css, mytheme/css/editor.css');

Is this correct? I've flushed the admin, but it still doesn't seem to be picking up the editor.css. I've tested it in another browser that shouldn't have the admin cached, to no avail. Have I got something wrong?

Thanks!
Sophie

Avatar
Platypus

10 February 2010 at 8:30pm (Last edited: 10 February 2010 8:34pm), Community Member, 43 Posts

Maybe the path should be

themes/mytheme/css/editor.css

in your case? That's where my editor.css usually hangs around ;-) Change 'mytheme' to the name of you're theme...

Avatar
Sophie

11 February 2010 at 4:08am Community Member, 33 Posts

Yes, yes, yes! Oh, so obvious. Thank you, Platypus! Everything is as it should be. Thank you all.

Sophie

Avatar
Samba Sam

17 February 2010 at 10:17am Community Member, 85 Posts

Thank goodness I found this post fairly quickly! I was having the same issue in the newest 2.3.6 stable version. Sticking the code above in my _config.php file fixed it.
Sam

Avatar
dryfly

23 February 2010 at 6:33am Community Member, 2 Posts

Thank you! I thought I was going out of my mind. I have an older site that works, but two newer sites that don't.

I appreciate the sanity check.

-Todd