I want to populate the Styles drop-down list with style definitions from an external CSS stylesheet file.
This is how I proceeded:
1) I created my css file. Its name is ´mysitestyles.css´and its contents is this:
I placed this file in this directory:
2) I activate the stylesheetparser plugin for my CKEditor by editing the file
introducing this line:
3) I supplied the location of the CSS file that contains my style definitions by using the contentsCss configuration setting editing the file
by introducing this line:
And remolving this one
After all this I would expect to open CKEditor and see in the Styles drop-down list my stile hh3.
But I don't see the style hh3 in the Styles drop-down list of CKEditor.
Any idea?
This is how I proceeded:
1) I created my css file. Its name is ´mysitestyles.css´and its contents is this:
hh3 { font: italic normal 1.4em georgia, sans-serif; letter-spacing: 1px; margin-bottom: 0; color: #7D775C; }
I placed this file in this directory:
sites/all/modules/ckeditor/ckeditor/mysitestyles.css
2) I activate the stylesheetparser plugin for my CKEditor by editing the file
sites/all/modules/ckeditor/ckeditor/_source/core/config.js
introducing this line:
config.extraPlugins = 'stylesheetparser';
3) I supplied the location of the CSS file that contains my style definitions by using the contentsCss configuration setting editing the file
sites/all/modules/ckeditor/ckeditor/_source/core/config.js
by introducing this line:
config.contentsCss = 'mysitestyles.css';
And remolving this one
/* contentsCss : CKEDITOR.basePath + 'contents.css',*/
After all this I would expect to open CKEditor and see in the Styles drop-down list my stile hh3.
But I don't see the style hh3 in the Styles drop-down list of CKEditor.
Any idea?
Re: CSS stylesheet file
First of all, what is your environment? Drupal version, CKEditor for Drupal module? Are you using the commercial module, or the Open Source one?
Documentation Manager, CKSource
See CKEditor 5 docs, CKEditor 4 docs, CKEditor 3 docs, CKFinder 3 docs, CKFinder 2 docs for help.
Visit the new CKEditor SDK for samples showcasing editor features to try out and download!
Re: CSS stylesheet file
Re: CSS stylesheet file
As I explained recently (viewtopic.php?p=63687#p63687) the stylesheet parser finds only the rules specified based on both a tag name and a class.
Your "hh3" refers only to an (inexistent) "hh3" element and lacks a class name, so the stylesheet parser can't use it.
Re: CSS stylesheet file
Re: CSS stylesheet file
As explained here, you can add your custom configuration either in the Drupal Administration panel (Configuration > Content Authoring > CKEditor, adjust the profile that you want to use in the Advanced options -> Custom JavaScript configuration section) or by adding your configuration settings to the "sites/all/modules/ckeditor/ckeditor.config.js" configuration file:
Documentation Manager, CKSource
See CKEditor 5 docs, CKEditor 4 docs, CKEditor 3 docs, CKFinder 3 docs, CKFinder 2 docs for help.
Visit the new CKEditor SDK for samples showcasing editor features to try out and download!
Re: CSS stylesheet file