Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Page Content Editor styles

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: 2147 Views
  • Jojo
    Avatar
    Community Member
    16 Posts

    Page Content Editor styles Link to this post

    This is my first use of Silverstripe so I'm learning as I go.

    How do I change the styles on the styles dropdown on the page content editor? I have downloaded the typography stylesheet from tutorial/css and made changes there but they don't appear on the dropdown editor. Also styles that do appear in the dropdown are not in the stylesheet. Is there another style sheet controlling those, or something else I should be doing?

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: Page Content Editor styles Link to this post

    The styles could be browser default stylings for headings etc as I think all browsers provide some sort of styling.

    Are any styles from your typography file appearing in the cms or none at all? What the backend should do is look for a 'editor.css' file. This file by default (eg in the default theme) loads typography.css via @import if it is not working then you should check if you have a editor.css file in your theme and that this is being included

  • Jojo
    Avatar
    Community Member
    16 Posts

    Re: Page Content Editor styles Link to this post

    Thanks for responding. I have since managed to change the existing styles in typography.css and have those apply to the display so the stylesheet is clearly working. To add a new style to the editor style dropdown, do I simply add a new style on the typography.css stylesheet?

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: Page Content Editor styles Link to this post

    no you can't add styles to the dropdown via the css file. Sadly the editor is not that clever lol. If you really need to add a style to that dropdown, currently the only method is a bit messy you will have to add an entry to the dropdown list in the PHP code - See HTMLEditorField.php line 280 - 290 for where it adds entries to that list

  • Jojo
    Avatar
    Community Member
    16 Posts

    Re: Page Content Editor styles Link to this post

    Thanks. Just one more question. On the dropdown there is an address style as well as h5 and h6. The address style is not in typography.css. Is that a default, and for what? Can I just add styles for h5 and h6 and they will apply on the dropdown?

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: Page Content Editor styles Link to this post

    yes. Typography may not have the styles for each of those. Any styles for elements not in typography could be the browsers defaults or being styled from some where else. All that dropdown does (when you select something) is wrap the html element round the text eg <h1>, <h2>, <address> etc... how that is styled must be defined in typography otherwise it will be taken from the browser

  • Jojo
    Avatar
    Community Member
    16 Posts

    Re: Page Content Editor styles Link to this post

    Thanks. Very Helpful. Is there somewhere in the Silverstripe help tutorials that I would have found all this, or should I just come back to thsi forum for further questions.

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: Page Content Editor styles Link to this post

    Not a tutorial as such and quite old documentation but - http://doc.silverstripe.com/doku.php?id=typography has a quick introduction / description of it

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