Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Configuring Style Menu in CKEditor Using StyleSheetParser Plugin View modes: 
User avatar
Member
Member
scott_hancock-urmc.rochester - 12/14/2011 12:37:44 PM
   
Configuring Style Menu in CKEditor Using StyleSheetParser Plugin
Hi,

I'm using V6 and I've configured the CKeditor to use the stylesheetparser plugin so the Style drop down is populated from an external css file. I've determined that when I enable the stylesheetparser plugin, the Style drop down is being populated from the CSS in the Kentico database. Is there any way to override this and populate the style drop down from a css file?

I've added/editted the following lines in the /CMSAdminControls/CKEditor/config.js.
    config.extraPlugins = 'CMSPlugins,stylesheetparser';
config.contentCss = '/CMSTemplates/URMC/content.css';
config.stylesSet = [];

I know I could edit the /CMSAdminControls/CKeditor/plugins/styles/defaults.js but I'd like to avoid having to convert my css to a js array.

Scott

User avatar
Member
Member
kentico_michal - 12/22/2011 5:18:34 AM
   
RE:Configuring Style Menu in CKEditor Using StyleSheetParser Plugin
Hello,

The contentCss is by default set during every CKeditor initialization. You can change the stylesheet used in the editor by going to the properties of the editable region web part and setting the "HTML editor css stylesheet:" to your stylesheet. The stylesheet has to be added in CMSSitemanager / Development / CSS Stylesheets. If the editor is used in some document property, this can be set in CMSSiteManager / Development / Document types / <your document type> / Fields / <your field> / CSS stylesheet.

Best regards,
Michal Legen

User avatar
Member
Member
scott_hancock-urmc.rochester - 12/29/2011 8:31:45 AM
   
RE:Configuring Style Menu in CKEditor Using StyleSheetParser Plugin
Just to clarify for others:

In Kentico v6 if you want the style dropdown in CKEditor to be populated from a particular css style sheet you need to:

1. Add/edit the following lines in the /CMSAdminControls/CKEditor/config.js.
config.extraPlugins = 'CMSPlugins,stylesheetparser';
config.stylesSet = [];

The first line enables the stylesheetparser plugin. The second disables the built in CKEditor stylesheet.

2. Create a CSS style sheet in Kentico.

3. Set the editor style sheet property in Kentico.
You can do this at the site level in the Site properties or "You can change the stylesheet used in the editor by going to the properties of the editable region web part and setting the "HTML editor css stylesheet:" to your stylesheet. The stylesheet has to be added in CMSSitemanager / Development / CSS Stylesheets. If the editor is used in some document property, this can be set in CMSSiteManager / Development / Document types / / Fields / / CSS stylesheet."

Scott