Page 1 of 1

Intermittent showing of styles in TinyMCE editor

Posted: Tue May 15, 2007 3:50 pm
by Anastasis
I am using the TinyMCE editor and when I add a page using one template the Styles combo is populated with styles from the CSS associations (two stylesheets) for that template.

However, with another template, no styles from the associated CSS stylesheets (again two of them, but different stylesheets) are listed in the Styles combo - it is empty apart from the default "-- Styles --" label.

I have checked the {stylesheet} tag is in the head section of the template and anyway, the page displays correctly style-wise when previewed showing it is reading the stylesheets (they are also listed in the source). So why are the available styles not showing in TinyMCE?

I am confused.  :(

Thanks in advance for any help on this.

Re: Intermittent showing of styles in TinyMCE editor

Posted: Tue May 15, 2007 4:45 pm
by alby
Anastasis wrote: However, with another template, no styles from the associated CSS stylesheets (again two of them, but different stylesheets) are listed in the Styles combo - it is empty apart from the default "-- Styles --" label.
Have you CSS ID only in this stylesheet?
Tinymce display CSS class only.

Alby

Re: Intermittent showing of styles in TinyMCE editor

Posted: Tue May 15, 2007 5:28 pm
by Anastasis
alby wrote: Have you CSS ID only in this stylesheet?
Tinymce display CSS class only.
Alby - Many thanks for your reply. I have both ID and class styles in the stylesheet. I even put a test class style at the start

.teststyle {
  font-weight: bold;
}

thinking that may be the cause as the class styles are further down, but that made no difference.

Re: Intermittent showing of styles in TinyMCE editor

Posted: Tue May 22, 2007 2:16 pm
by Anastasis
OK, I have finally managed to resolve this issue.

It happens when the "All" option in the Stylesheet media types is checked. Unchecking it and checking "Screen" instead fixed it.

Seems like a bug - should that be reported somewhere?

I hope this helps anyone experiencing the same.

Re: Intermittent showing of styles in TinyMCE editor

Posted: Tue May 22, 2007 10:30 pm
by groinko
I've had the same problem and I've solved it, as you did, by checking "screen" in my stylesheet options.
A good resume : http://forum.cmsmadesimple.org/index.ph ... 49043.html

BUT...
when I apply a style it seems to be ok, but having a look at the html source code :

Code: Select all

<span class="teststyle" class="teststyle">Hello world</span>
the class is wrritten twice !?!?

Re: Intermittent showing of styles in TinyMCE editor

Posted: Mon Jul 13, 2009 4:59 pm
by iandunn
I had the same problem, but the sheet was already set as only "screen." When I checked "all" it fixed one page, but broke another.

Re: Intermittent showing of styles in TinyMCE editor

Posted: Wed Jul 15, 2009 7:29 pm
by iandunn
Another thing to keep in mind is that CSS selectors are case-sensative, and for some reason CMSMS transforms them to lowercase in the editor, so you need to make sure that you declare them in lowercase in your stylesheet.

Re: Intermittent showing of styles in TinyMCE editor

Posted: Wed Jul 22, 2009 9:20 pm
by Dr.CSS
All html and css should be in lower case, imho...