Hi all,
I've got a problem with FCKeditor. I'm using a custom CSS file to be applied on the content of FCKeditor. This CSS file comes from several themes from some sites in production.
The CSS I want to be applied on the content of FCKeditor starts with this selector:
Now the problem is, I already checked the FCKeditor configuration and I found some useful options:
This creates a wrapper for the content like this:
What I would like to become is this:
The styles I need aren't applied correctly if I only use the FCKConfig properties I mentioned...
If I add the wrapper:
manually in the content and then add h's, p's, ul's, ol's, ... the styles are applied correctly! But I can't expect my content editors to add this wrapper to every piece of content they add to the production sites (this will also cause XHTML validity problems, because the id "content-template" would be used multiple times).
I could also change the CSS files, but then I would have to change a lot and replace some stuff from production sites.
So I was looking for a solution to add the wrapper in the FCKeditor source.
I checked the core (where the BodyAttributes are used) in fck.js and added the wrapper in the JavaScript and changed fckeditor.html and fckeditor.original.html (added the wrapper in HTML) but all these changes had no effect!
Can someone help me with this problem?
Thanks in advance for any replies!
Kind regards,
Sweepee
I've got a problem with FCKeditor. I'm using a custom CSS file to be applied on the content of FCKeditor. This CSS file comes from several themes from some sites in production.
The CSS I want to be applied on the content of FCKeditor starts with this selector:
#content-template .left.text { ... }
Now the problem is, I already checked the FCKeditor configuration and I found some useful options:
FCKConfig.BodyId = "content-template"; FCKConfig.BodyClass = "left text";
This creates a wrapper for the content like this:
<body id="content-template" class="left text"> ... </body>
What I would like to become is this:
<body id="content-template"><div class="left text"> ... </div> </body>
The styles I need aren't applied correctly if I only use the FCKConfig properties I mentioned...
If I add the wrapper:
<div class="left text"></div>
manually in the content and then add h's, p's, ul's, ol's, ... the styles are applied correctly! But I can't expect my content editors to add this wrapper to every piece of content they add to the production sites (this will also cause XHTML validity problems, because the id "content-template" would be used multiple times).
I could also change the CSS files, but then I would have to change a lot and replace some stuff from production sites.
So I was looking for a solution to add the wrapper in the FCKeditor source.
I checked the core (where the BodyAttributes are used) in fck.js and added the wrapper in the JavaScript and changed fckeditor.html and fckeditor.original.html (added the wrapper in HTML) but all these changes had no effect!
Can someone help me with this problem?
Thanks in advance for any replies!
Kind regards,
Sweepee
body (css) wrappers
There are lots of posts about this subject, but none ever offered a solution.
I decided to dive into the ckeditor core code myself and came up with a simple modification that works like a charm.
for details see my ckeditor ticket:
https://dev.ckeditor.com/ticket/9774
the actual ckeditor code changes:
https://dev.ckeditor.com/attachment/ticket/9774/bodywrap.patch
(note that this 'patch' is applied to ckeditor 3.6.2 , not Fckeditor)