Currently the Styles drop down adds HTML in the form of
I would like to use an external style sheet (external to the FCK Editor) and have the class applied so if my external style sheet has a
Another config file would associate the class names with their attributes e.g.
and the config file would be parsed at runtime to generate the drop down list (or what ever would work). Parsing the names of the styles directly would work too e.g. Parse for .highlight_text{ and remove the underscore to generate the drop down list.
Then the styles drop down has 'highlight text' and I get to call the style directly from the sheet. The HTML would then be
The advantage would be I can use PHP to swap the stylesheet that is loaded or update it without modifying the FCK editor code at all. Currently if I make text red using the FCK editor and save it to a file I need to open up that file and change all references from red to blue in the inline styles. If it was done using the method I'm suggesting then changing the text from red to blue would be a single change in the external stylesheet.
The FCK end user would have the same experience, website developers using FCK would have more control, inline styles would be a thing of the past and everyone would live happily ever after.
We would be willing to pay to have the FCK editor modified to include this feature. If this is something you feel you can do, please let me know by private message or in this thread with a quote for the mod.
Thanks
<span style="background-color: yellow">test here</span>
I would like to use an external style sheet (external to the FCK Editor) and have the class applied so if my external style sheet has a
.highlight_text{ color:red; }
Another config file would associate the class names with their attributes e.g.
highlight-"highlight text"
and the config file would be parsed at runtime to generate the drop down list (or what ever would work). Parsing the names of the styles directly would work too e.g. Parse for .highlight_text{ and remove the underscore to generate the drop down list.
Then the styles drop down has 'highlight text' and I get to call the style directly from the sheet. The HTML would then be
<span class="highlight_text">test here</span>
The advantage would be I can use PHP to swap the stylesheet that is loaded or update it without modifying the FCK editor code at all. Currently if I make text red using the FCK editor and save it to a file I need to open up that file and change all references from red to blue in the inline styles. If it was done using the method I'm suggesting then changing the text from red to blue would be a single change in the external stylesheet.
The FCK end user would have the same experience, website developers using FCK would have more control, inline styles would be a thing of the past and everyone would live happily ever after.
We would be willing to pay to have the FCK editor modified to include this feature. If this is something you feel you can do, please let me know by private message or in this thread with a quote for the mod.
Thanks
Re: style of styles, paid support request.
I'm still looking for a quote on this mod, a chance to makes some money!! I would have expected a few more replies
This is an important feature change that IMO should be the way it's done. Inline styles are generally a bad idea.
I've looked a bit more into the code and understand FCK a little more. I think this might be a good way to achive CSS classes over inline styles.
include my external style sheet with a new FCKConfig eg.
Parse the styles XML file
but allow classes to be added to it like this
So the Styles dropdown has a 'Highlight text' option, which adds the HTML for a CSS class, not an inline style.
Now when I change my style sheet I can update all spans using the highlight text class, without having to alter the HTML or reload the page into FCK and edit each one manually.
I've looked at alfonsoml patch on ticket 901 (thanks for the link alfonsoml). I may be implementing it wrong but it breaks the current version. FCKeditor.php calls version 4 or 5 which the patch FCKeditor.php file doesn't, It looks more like the version file thats called. Version 5 FCKeditor_php5.php is a very different file to the one provided in the patch.
Seriously, please send me a quote for this mod.
Ideally it would become part of the FCK editor so we can update to future versions without breaking the editor or the mod.
Re: Styles, paid support request.
But now what you want seems to be possible without anything extra. Check sample 14 about how to use classes.