Jump to:

1384 Posts in 493 Topics by 522 members

Themes

SilverStripe Forums » Themes » Editor.css in 2.3.4 not pulling in typography style sheet

Discuss SilverStripe Themes.

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

Page: 1
Go to End
Author Topic: 2182 Views
  • Sophie
    Avatar
    Community Member
    33 Posts

    Editor.css in 2.3.4 not pulling in typography style sheet Link to this post

    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

  • MateuszU
    Avatar
    Community Member
    89 Posts

    Re: Editor.css in 2.3.4 not pulling in typography style sheet Link to this post

    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

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Editor.css in 2.3.4 not pulling in typography style sheet Link to this post

    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.

  • Sophie
    Avatar
    Community Member
    33 Posts

    Re: Editor.css in 2.3.4 not pulling in typography style sheet Link to this post

    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

  • Platypus
    Avatar
    Community Member
    43 Posts

    Re: Editor.css in 2.3.4 not pulling in typography style sheet Link to this post

    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...

  • Sophie
    Avatar
    Community Member
    33 Posts

    Re: Editor.css in 2.3.4 not pulling in typography style sheet Link to this post

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

    Sophie

  • Samba Sam
    Avatar
    Community Member
    85 Posts

    Re: Editor.css in 2.3.4 not pulling in typography style sheet Link to this post

    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

  • dryfly
    Avatar
    Community Member
    2 Posts

    Re: Editor.css in 2.3.4 not pulling in typography style sheet Link to this post

    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

    2182 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.