Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CKeditor stylesheet
06-23-2013, 09:04 AM
Post: #1
CKeditor stylesheet
There is no subforum for the CKeditor forum so I post my question here.

I have been trying to make certain styles available in the CKeditor when you create or update a document.

I added styles to /system/modules/ckeditor/example.css
I added a link to a stylesheet in Dashboard/Settings/clearFusionCMS : Content Editing

But whatever I try, I cannot get the styles to load in the menus of CKeditor, and also if I add the style classes in the source code, the classes get deleted when I switch to WYSIWYG mode.
Find all posts by this user
Quote this message in a reply
06-23-2013, 10:29 AM
Post: #2
RE: CKeditor stylesheet
If you edit example.css and add
Code:
body { background-color: #0f0; }
Then try editing doesn't the background color of the editor change to green?

CK is pretty aggressive at removing style sheets etc from the content, it assumes that they should all be placed in the template.

clearFusionCMS Lead Developer
Find all posts by this user
Quote this message in a reply
06-23-2013, 11:24 AM
Post: #3
RE: CKeditor stylesheet
I've just emailed you the module based on the 4.1.2 build of CKEditor, just go into modules and upload the ZIP file. Next you need to clear your browser cache or you may find the JavaScript for the editor doesn't reload.

If you have a CSS file in the modules/ckeditor folder you want to keep then copy it before you run the upgrade as it'll get overwritten/removed.

clearFusionCMS Lead Developer
Find all posts by this user
Quote this message in a reply
06-23-2013, 01:41 PM
Post: #4
RE: CKeditor stylesheet
Cannot get it to work.
I can see in the source of /manager/documents/1/ that CK is asking for the contentCSS file correctly.
I also can see that filebrowserBrowseUrl refers to /manager/browsefiles/public/ckeditor/ which is not a real folder I take it, because I cannot see a /manager/ folder on the server.
Could that be it?
I tried to link the css absolute, ie including the http:// etc but still no go.

There is also a setting like this in the source of /manager/documents/1/
stylesSet : [],
Does that only refer to the fact that sets of styles are grouped within [ and ] or does it need something between these square brackets?

Let me know if you want access details.
Find all posts by this user
Quote this message in a reply
06-23-2013, 04:05 PM
Post: #5
RE: CKeditor stylesheet
Found this:
http://docs.cksource.com/CKEditor_3.x/De...ide/Styles

It looks like I need to add the styles to /system/modules/ckeditor/ckeditor/styles.js

But that would give trouble with an upgrade of the module.
It seems I cannet get the /system/modules/ckeditor/ckeditor/styles.js file to work, maybe the reference in /system/modules/ckeditor/ckeditor/ckeditor.js is wrong?

[not that i really know what I am talking about ...]
Find all posts by this user
Quote this message in a reply
06-23-2013, 05:45 PM
Post: #6
RE: CKeditor stylesheet
On closer scrutiny of
/manager/browsefiles/public/ckeditor/
it seems to be missing this line:
extraPlugins = 'stylesheetparser';
on about line 362

Maybe, maybe not ...

Because I do not know where to find the file, I could not test it
Find all posts by this user
Quote this message in a reply
06-23-2013, 07:56 PM (This post was last modified: 06-23-2013 08:06 PM by John.)
Post: #7
RE: CKeditor stylesheet
Might have fixed it:

Changed ckeditorWYSIWYG.php to include

if(!empty($settings['css']))
$js .= ",
extraPlugins : 'stylesheetparser',
contentsCss : '$settings[css]',
stylesSet : []";
Find all posts by this user
Quote this message in a reply
06-23-2013, 09:46 PM
Post: #8
RE: CKeditor stylesheet
Hmm, for some strange reason I didn't get notifications of your replies.

So the updated version with CKEditor 4.1.2 didn't work for you either?
Did you get the Styles drop down or is that not showing?

The stylesheetparser is referenced in the config file for the editor so it shouldn't need the extraPlugins option.

clearFusionCMS Lead Developer
Find all posts by this user
Quote this message in a reply
06-23-2013, 10:07 PM (This post was last modified: 06-23-2013 10:08 PM by John.)
Post: #9
RE: CKeditor stylesheet
(06-23-2013 09:46 PM)paul Wrote:  Hmm, for some strange reason I didn't get notifications of your replies.
I thought for once you had a day off, you're allowed to you know Smile

(06-23-2013 09:46 PM)paul Wrote:  So the updated version with CKEditor 4.1.2 didn't work for you either?
Did you get the Styles drop down or is that not showing?

The stylesheetparser is referenced in the config file for the editor so it shouldn't need the extraPlugins option.
I tried deleting the line
extraPlugins : 'stylesheetparser',
but then all the styles disappear on saving the document. I am sure you need it, unless we have a different config file?
As soon I add extraPlugins : 'stylesheetparser', back the styles appear again at least in the source file and in the editor screen.
I got the styles drop down but there is nothing showing in the drop down.
Find all posts by this user
Quote this message in a reply
06-23-2013, 10:15 PM
Post: #10
RE: CKeditor stylesheet
What's a day off? Confused
There's too many things I want to do with clearFusionCMS.

Can you try:
  • Go to Module and uninstall CKEditor, select delete files before you uninstall
  • Still in Modules upload the CKEditor 4.1.2 ZIP I emailed you
  • Click install next to CKEdit
  • Go Dashboard > Settings > clearFusionCMS > Content Editing and select CKEditor as the WYSIWYG editor
  • Clear your browser cache
That forces a complete install of the ck module.

You also need to make sure that your CSS file is referenced from the root e.g. /system/modules/ckeditor/example.css (should be accessible in the browser if you try), that should then give you the styles dropdown which should then be populated with the styles in this case from the example.css file.

clearFusionCMS Lead Developer
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)