Using CSS with Tinymce 2.2

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
musicscore
Power Poster
Power Poster
Posts: 477
Joined: Wed Jan 25, 2006 11:53 am
Location: Netherlands

Using CSS with Tinymce 2.2

Post by musicscore »

I know, it's a stupid question and it's telling everybody that I'm a real newby.  :-[
I know there are a lot of post about stylesheets and Tinymce and I read them (took me some hours)  >:(
I know these a Wiki about Tinymce and there's a lot of documentation.  ???
But ......

I CANN'T GET IT WORKING

I want to use the same fonts and layout in the editor of TinyMCE 2.2 as I get on my site

I read I have to put my css in 'Content.css", the stylesheet of Tinymce

I tryed "editor_ui.css", put in my.css but nothing seems to work.

What should I do to get my page fonts (and Css) in the tinymce editor


???????????????

musicscore
SimonSchaufi

Re: Using CSS with Tinymce 2.2

Post by SimonSchaufi »

is there a problem with the module or with the styles?

do you have the stylesheets and templates "connected"?
musicscore
Power Poster
Power Poster
Posts: 477
Joined: Wed Jan 25, 2006 11:53 am
Location: Netherlands

Re: Using CSS with Tinymce 2.2

Post by musicscore »

No.
How do I connect the templates and stylesheets ?
musicscore
Power Poster
Power Poster
Posts: 477
Joined: Wed Jan 25, 2006 11:53 am
Location: Netherlands

Re: Using CSS with Tinymce 2.2

Post by musicscore »

Hello,

Is someone there ?? Can someone please help me.

Thanx

Musicscore
cyberman

Re: Using CSS with Tinymce 2.2

Post by cyberman »

musicscore wrote: How do I connect the templates and stylesheets ?
You can do it in menu Layout > templates. On right columns there you can found a yellow icon with title CSS inside. Click it and you can attach stylesheets to your template ;).
musicscore
Power Poster
Power Poster
Posts: 477
Joined: Wed Jan 25, 2006 11:53 am
Location: Netherlands

Re: Using CSS with Tinymce 2.2

Post by musicscore »

I have build my complete site with templates and css but the question is ..

When I use TinyMCE (the best editor I know) the styles (expl. Headers -> underline) are not shown in the editor.
On my pages everything works perfect.

Musicscore
musicscore
Power Poster
Power Poster
Posts: 477
Joined: Wed Jan 25, 2006 11:53 am
Location: Netherlands

Re: Using CSS with Tinymce 2.2

Post by musicscore »

I modifyed my CSS file

I normaly use a css for every block expl

BlockI  h1 {
  font-family : verdana;
  font-color : red;
  etc.
}

BlockII  h1 {
  font-family : courier;
  font-color : green;
  etc.
}


After adding

h1 {
  font-family : verdana;
  font-color : red;
  etc.
}


it shows up in FCKEditorX but still not in TinyMCE 2.2

What is the problem ???
Ned Nowotny
Forum Members
Forum Members
Posts: 32
Joined: Mon Jan 29, 2007 1:19 am

Re: Using CSS with Tinymce 2.2

Post by Ned Nowotny »

TinyMCE will only process CSS style sheets where the "Media Type" is explicitly set to "screen".  At least, this was true of the version available in January for CMSMS 1.0.4.  For more information, see:

    Tips on using TinyMCE and CSS Style Sheets
User avatar
Silmarillion
Dev Team Member
Dev Team Member
Posts: 483
Joined: Sun Jan 02, 2005 9:10 pm
Location: Denmark

Re: Using CSS with Tinymce 2.2

Post by Silmarillion »

Hmmm, the thing about Tiny only including styles marked as suited for "screen" could probably be changed, would that be better, or does it make sense?

sil.
Ned Nowotny
Forum Members
Forum Members
Posts: 32
Joined: Mon Jan 29, 2007 1:19 am

Re: Using CSS with Tinymce 2.2

Post by Ned Nowotny »

At a minimum, stylesheets that have no "Media Type" selected or that have the "all" media type selected should be processed along with "screen" media type stylesheets.  (No selection should correspond to omitting the "media" attribute from "link" or "style" HTML tags.  Because "screen" is the default value for the "media" attribute, the stylesheet should be processed as if "screen" was explicitly selected.)

Then again, styles from all associated stylesheets should be added to the "Style" drop-down menu.  Otherwise, the user needs to edit raw HTML to add styles to the mark-up for "print," "aural," or other media types.  The stylesheet media type is only important for proper WYSIWYG rendering, not HTML editing.

In fact, I'll open a bug report to request that change...
User avatar
Silmarillion
Dev Team Member
Dev Team Member
Posts: 483
Joined: Sun Jan 02, 2005 9:10 pm
Location: Denmark

Re: Using CSS with Tinymce 2.2

Post by Silmarillion »

cool, I'll get to it as soon as I find the time!

sil.
musicscore
Power Poster
Power Poster
Posts: 477
Joined: Wed Jan 25, 2006 11:53 am
Location: Netherlands

Re: Using CSS with Tinymce 2.2

Post by musicscore »

I cannot get it to work with TinyMCE

I put in the CSS file :

BlockI  h1 {
  font-family : verdana;
  font-color : red;
  etc.
}

BlockII  h1 {
  font-family : courier;
  font-color : green;
  etc.
}

After adding

h1 {
  font-family : verdana;
  font-color : red;
  etc.
}


it shows up in FCKEditorX but still not in TinyMCE 2.2
The stylesheet is set to screen mode but I also tryed the all mode.

When I select heading 1 you do not see the red color for example. Looking at the page, the color is there but not in TinyMCE.


What is the problem  ???
Post Reply

Return to “Modules/Add-Ons”