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

Issue with HtmlEditorField and typography class in CMS


Go to End


1234 Views

Avatar
TotalNet

Community Member, 181 Posts

18 June 2010 at 4:45pm

Upgrading a site to 2.4.0 and noticed something odd. a minor thing to be fair but...

The div containing tinyMCE (id = Content) now has an extra class of typography, and because my theme set's padding and margin on the typography class it's messing up the size and alignment in the CMS.

It wasn't a problem in 2.3.x because the containing div did not have this class.

I see that HtmlEditorField->Field() has changed quite a bit in 2.4.0, now calling addExtraClass() for example and we now end up with:

<div id="Content" class="field htmleditor  typography htmleditor">
in addition to the textarea tag also having the attribute of typography.

I've tried to trace the path back through TextAreaField and FormField but just ending up in circles, perhaps it's because it's 4.30pm on a Friday!

Anyway, I'll try to get round this with extra CSS rules for now but I'm pretty sure this is not intended behaviour. Assuming you want the same styling on the containers and their form elements could get confusing.

Cheers,

Rich