17487 Posts in 4473 Topics by 1978 members
|Go to End|
30 September 2008 at 1:37pm
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?
30 September 2008 at 4:56pm
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
30 September 2008 at 5:05pm
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?
30 September 2008 at 5:36pm
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
30 September 2008 at 5:59pm
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?
30 September 2008 at 9:15pm
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
30 September 2008 at 9:23pm
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.
30 September 2008 at 9:32pm
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
|Go to Top|