Enabling a Spell Checker for a WYSIWYG Editor
Activate the Spell Checker feature of the FCKEditor component in your cockpit based application.
- Install GNU Aspell.
- Download the dictionaries for the languages that you want to support in the Aspell.
- Place the Platform in the directory path without any spaces in its filename.
Configuration
There are basically two files you have to add or edit. In the ProductCockpit extension there is only one file.
Configuration File for FCKEditor
In the default cockpit FCKEditor configuration, the spell checker icon is not visible, so you have to create a new one.
In the ProductCockpit extension a configuration file is already provided, so if you just want to enable spell checker there, you can skip this step.
If you have your own cockpit, you can use the following as template:
FCKConfig.ToolbarSets["Default"] = [ ['Source','Preview','ShowBlocks','Print', 'Undo','Redo','-', 'SpellCheck', '-','Find','Replace','-','SelectAll','RemoveFormat','-', 'Subscript','Superscript','-','Outdent','Indent','Blockquote'], '/', ['Bold','Italic','Underline','StrikeThrough','-', 'JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','-', 'OrderedList','UnorderedList','-','Link','Unlink','Anchor','-', 'Image','Table','Rule','SpecialChar','PageBreak'], '/', ['FontFormat','FontName','FontSize'] ] ; FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/silver/' ; FCKConfig.SpellChecker = 'SpellerPages' ; FCKConfig.SpellerPagesServerScript = '/productcockpit/cockpit/spellerpages/server-scripts/spellchecker.jsp' ;
Adjust the FCKConfig.SpellerPagesServerScript variable and save the file in the webroot folder.
ZK.xml
Now you have to set two preference values in the zk.xml:
- The URL for your FCKEditor config
- The system path to your aspell binary
The following example shows the configuration for the ProductCockpit extension on linux.
<preference> <name>de.hybris.platform.cockpit.fckconfig</name> <value>/productcockpit/customcomponents/productcockpit-fck-config.js</value> </preference> <preference> <name>de.hybris.platform.cockpit.path_to_aspell</name> <value>/usr/bin/aspell</value> <!--WINDOWS <value>C:\Progra~1\Aspell\bin\aspell.exe</value>--> <!-- APPLE <value>/opt/local/bin/aspell</value> --> </preference>