Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » No CSS Styling IN WYSIWYG

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 2327 Views
  • benedictporter
    Avatar
    Community Member
    16 Posts

    No CSS Styling IN WYSIWYG Link to this post

    Hey,

    I'm building a site at the moment but I can't get my style sheet to reflect in the TinyMCE WYSIWYG. I have both typography.css and editor.css sheets in the mysite/css folder but the styling is not showing up.

    Any ideas?

  • Howard
    Avatar
    Community Member
    215 Posts

    Re: No CSS Styling IN WYSIWYG Link to this post

    Which version are you using?

    And to get your styles into the WYSIWYG editor they must start with .typography for example you might have:

    .typography p{ font-size: 11px; }

  • benedictporter
    Avatar
    Community Member
    16 Posts

    Re: No CSS Styling IN WYSIWYG Link to this post

    I think I may have missed something here.

    Does typography have to be a class to work correctly and appear in the TinyMCE WYSIWYG?

    I have <div id="typography"></div> in my template at the moment. Should this be <div class="typography"></div>?

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: No CSS Styling IN WYSIWYG Link to this post

    In SS 2.2.x you place your styles in either editor.css or typography.css. By default editor.ss calls in the typography.css file to be included, but you can change this.

    You can name your classes whatever you want and they should work. However, there is no easy way in SS 2.2.x to include these custom classes in the tinymce drop down. You'd have to manually add them in the html source.

    With SS 2.3 which is due out in the near future, this problem is a lot easier. Any custom classes you put in your editor/typography css file automatically gets pulled into the tinymce drop down which makes applying them to a specific element a breeze.

    If you're putting everything in those 2 files and it still isn't showing up, it could be a caching issue with your browser. I find this happens sometimes.

    That or maybe you have to put them in your theme directory? I don't think this is the case, but I can't remember to be honest. I never use the theme directory with sites I build and my memory isn't all that great.

  • benedictporter
    Avatar
    Community Member
    16 Posts

    Re: No CSS Styling IN WYSIWYG Link to this post

    I'm still not getting any styling in the WYSIWYG.

    I'm using 2.2.3 if that makes nay difference. I have all the files in mysite/css and I have both a typography.css and an editor.css which imports the typography styles. I don't want to do anything fancy at this stage, just the basics (p, h1 etc.)

    I've tried in several browsers and cleared my caches etc. but still no joy. I suspect it may be something very simple that I have missed.

    Would working in dev make a difference?

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: No CSS Styling IN WYSIWYG Link to this post

    If you switch back to the blackcandy theme do styles in the cms appear?

  • benedictporter
    Avatar
    Community Member
    16 Posts

    Re: No CSS Styling IN WYSIWYG Link to this post

    I changed themes and the styling appeared.

    I have moved mysite into the themes directory and the styling is now appearing in the WYSIWYG however the font size is tiny. I assume I can just alter this in editor.css?

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