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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

Changing p and h1 tags in the page editor


Go to End


5 Posts   2065 Views

Avatar
JoelMurdoch

Community Member, 16 Posts

7 January 2010 at 9:14pm

Hi everybody,

I am having a world of trouble trying to make the h1 and p tags show in the page editor in the same style they do on the site. I tried editing the typography css file of my theme as another thread on this forum says, but it made no difference. I tried both a normal p definition and .typography p definition. Force refreshed the CSS to ensure it was in my browser's case, flushed the db... nothing.

Any help greatly appreciated.
Joel.

Avatar
Juanitou

Community Member, 323 Posts

7 January 2010 at 11:05pm

Hi Joel,

You need an editor.css file, see here:
http://doc.silverstripe.org/doku.php?id=css#wysiwyg_editor_stylesheet_typography.css_editor.css

Hope it helps,
Juan

Avatar
bummzack

Community Member, 904 Posts

8 January 2010 at 11:00am

As far as I know, there's a bug in 2.3.4 that prevents the editor.css file from loading. So even if you have the editor.css file, it might not get loaded still.
To fix this, add the following line to mysite/_config.php

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

The red colored part is where you specify the path to your editor.css file

Avatar
JoelMurdoch

Community Member, 16 Posts

12 January 2010 at 12:27am

OK. So what is the difference between the typography css and the editor css? I tried editing the former which is loaded on the editor pages (you can see it in the source code), but it did not seem to be helping.

Is the typography set of classes the ones I need to be editing or is there something else? Because it did not work out editing them in the typography one and I cannot see how trying to change it with a different CSS. I am not trying to be argumentative here, just looking for clarification.

Thanks :)

Avatar
JoelMurdoch

Community Member, 16 Posts

18 January 2010 at 11:56pm

Anybody?