Design and CSS styles
Version 4.x > Design and CSS styles > FCKEditor Style Name For Each Site View modes: 
User avatar
Member
Member
jonkuehn - 3/11/2009 8:41:16 AM
   
FCKEditor Style Name For Each Site
Is there a way to limit the class names that display in the FCKEditor Style dropdown on a site-by-site basis? For example, Site A would have SiteA_Header, SiteA_SubHeader in the dropdown. Site B would have SiteB_Header, SiteB_SubHeader and so on. Right now, I have a common set of class names defined in fckstyles.xml and the Editor CSS Stylesheet defines those classes on a site-by-site basis. I would like to be able to have unique class names for each site.

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 3/13/2009 12:14:54 PM
   
RE:FCKEditor Style Name For Each Site
Hi,

I like the idea, but unfortunatelly this (as I'm getting it) isn't possible in any known way.
As the styles (and/or class definitions) are cached by browser, the only way would be altering of FCKEditor code itself.

Maybe FCKEditor community could also provide some hints.

If you find some more info about this, we will appreciate if you let us know.

Regards,
Zdenek C.

User avatar
Member
Member
brandon - 3/13/2009 1:19:44 PM
   
RE:FCKEditor Style Name For Each Site
Zdenek - please let me know if I am understanding this correctly. There is no way to specify that the FCK editor uses a different stylesheet for each site?

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 3/19/2009 11:36:04 AM
   
RE:FCKEditor Style Name For Each Site
Hi,

fortunatelly no, there could be a way to accomplish this.
However, some javascript programming will be needed.

You could edit fckstyles.js from full FCKeditor package path "editor\_source\internals\" function _LoadStylesXml : function()

Right at the beginning of the following "for" cycle:

// Add each style to our "Styles" collection.
for ( var i = 0 ; i < styleNodes.length ; i++ )


..here you could compare actual domain with the style name prefix and either remove it (if it's not suited for the current domain-site) or keep it (probably with removing the prefix for better appearance) in the list (array).

By default, this code is part of "inline compressed" code in the files "fckeditorcode_gecko.js" and "fckeditorcode_ie.js"
The resulting code after modifications can be either put into the appropriate folder "as is", or there is some "manual" or "tool" how to inline-compress the souce code. Please refer to FCKeditor pages or google :)

Hope this will work. We will appreciate if you let us know...
Thanks.

Best regards,
Zdenek C.



User avatar
Member
Member
jpk - 3/26/2009 9:36:17 AM
   
RE:FCKEditor Style Name For Each Site
The suggestion in this thread works great...

http://devnet.kentico.com/Forums/f39/t7569/Styles-in-FCK-Editor.aspx