Page 1 of 1

FCKeditorX & styles

Posted: Sun Jan 01, 2006 10:45 am
by pinthenet
Could someone give me a simple explanation how to add my site CSS to FCKeditor's style dropdown  plse? I've read a couple of posts but I'm still unclear as to what I should put in the 'Body tag CSS' field in admin. With nothing or 'default' I get a couple of styles that seem to be from my site's CSS but with odd 'squashed' entries in bewteen.

?
Thanks in advance and a happy new year to all readers!

John

Re: FCKeditorX & styles

Posted: Sun Jan 01, 2006 11:42 am
by westis
Hi John,

It's actually not quite working for me yet either. But I think you're supposed to put the styles like you would in a stylesheet, like this:

Code: Select all

.classone { 
   font-size: 1.2em; 
   color: #cccccc;
}
This is presuming that this class also exists in one of the stylesheets attached to your template, otherwise it will not display the expected way on the frontend.

My problem is that nothing shows in the dropdown when I'm trying it out myself, it's just empty. It's ok on MegaBob's test site though, don't know what it may be....

Re: FCKeditorX & styles

Posted: Mon Jan 02, 2006 11:42 am
by pinthenet
Thanks westis - that's a relief.

Seems a bit involved if you have a more complex style sheet or if you make changes. On the other hand I suppose I can then control which styles a user can use - many are not really necessary (or safe) for editors.

For megabob - it would be (or would it be?) good if the field in admin would expect the path/name of a css file with the styles needed?

John

Re: FCKeditorX & styles

Posted: Mon Mar 13, 2006 8:22 pm
by Caspar
westis wrote: My problem is that nothing shows in the dropdown when I'm trying it out myself, it's just empty. It's ok on MegaBob's test site though, don't know what it may be....
that's my problem now, too...
does anyone have a clue why it worked in 0.11 and now doesn't? how about updating single files?

thanks, cas

Re: FCKeditorX & styles

Posted: Tue Mar 14, 2006 12:46 am
by kiwikeith
Am having exactly the same problem with my drop down styles not appearing. Can anyone help please?

Re: FCKeditorX & styles

Posted: Tue Mar 14, 2006 2:22 am
by kiwikeith
Managed to get it to work. It seems if you just use simple CSS classes - e.g. .style { font-size: 1.1em; } and put them both in your CSS file and the FCKEditor Styles tab, PLUS don't give a media type for the stylesheet.

I previously had a media type of screen. I had no styles in the drop down. Take out the media type. A style appeared. :o)

Re: FCKeditorX & styles

Posted: Tue Mar 14, 2006 8:10 am
by Caspar
kiwikeith wrote: PLUS don't give a media type for the stylesheet.
I previously had a media type of screen. I had no styles in the drop down. Take out the media type. A style appeared. :o)
In fact, it works. It's defintely the media type. I left it empty for only one of my attached stylesheet - and only the css classes of that particular one are displayed in the drop-down field of FCK. It's a little weird, isn't it? ???
Anyway, thanks a bunch, Keith!  :)

Re: FCKeditorX & styles

Posted: Sat Mar 25, 2006 4:51 pm
by Nanochild
Hi!

I got it to work with styles but not 100%

I inserted these style sheets into the FCKeditorX:

.h1 {

font-family:arial, serif, helvetica;
font-style:normal;
font-weight:bold;
font-size:18px;
color:rgb(0,0,0);

}

.h2 {

font-family:arial, serif, helvetica;
font-style:normal;
font-weight:bold;
font-size:16px;
color:rgb(0,0,0);

}

.h3 {

font-family:arial, serif, helvetica;
font-style:normal;
font-weight:bold;
font-size:15px;
color:rgb(0,0,0);

}

.h4 {

font-family:arial, serif, helvetica;
font-style:normal;
font-weight:bold;
font-size:14px;
color:rgb(0,0,0);

}

.h5 {

font-family:arial, serif, helvetica;
font-style:normal;
font-weight:bold;
font-size:13px;
color:rgb(0,0,0);

}

.h6 {

font-family:arial, serif, helvetica;
font-style:normal;
font-weight:bold;
font-size:12px;
color:rgb(0,0,0);

}

.p {

font-family:arial, serif, helvetica;
font-style:normal;
font-weight:normal;
font-size:12px;
color:rgb(0,0,0);

}

.pre {

font-family:arial, serif, helvetica;
font-style:normal;
font-weight:normal;
font-size:12px;
color:rgb(0,0,0);

}

.address {

font-family:arial, serif, helvetica;
font-style:normal;
font-weight:normal;
font-size:12px;
color:rgb(0,0,0);

}

This works fine when you just insert the text as ASCII on the pages in the FCKeditorX, but when i change the first line to a "h1" from the style dropdown, it write out a totally wrong no-standard code:


Header

Some text here


Where is the -end tag..?

This is illegal code and where did these -things comming from - i want totally clean code and i dont want to learn my customers how to program in HTML, but it seems that it´s not possible..?

Remember W3C (World Wide Web Consortium)..!

Just clean code please, it must be possible for GOD sake...

And yes, i am a little bit annoyed...

But no matter what, thanks..!

Re: FCKeditorX & styles

Posted: Sun Mar 26, 2006 10:47 pm
by chilsta
And yes, i am a little bit annoyed...
Hi- it's OK- relax, chill...

FCK is doing exactly what you're asking, but your asking it for the wrong thing. When you're referencing a standard HTML element, you don't put a "." in front of the element name. What you've done is create a load of new classes (.h1, .h2 etc...), and it's applying them for you in spans.

i.e.

you have:
.h1 {...

you should have
h1 {...

(that applies to your whole list there- delete all the "."s from before the element name)
Where is the -end tag..?
Look again, there's no start tag either.
This is illegal code
..actually, it's not- the code that FCK generated for you is 100% standards compliant.

HTH

C*

Re: FCKeditorX & styles

Posted: Thu Mar 30, 2006 8:10 am
by Nanochild
Thx for your reply and sry for my overwhelming bad move (i so bad)..!

???