Wednesday, January 5, 2011

Setup for Drupal, CKEditor and FMath Editor for mathematics

Hi,

The settings to install fMath Editor with Drupal / CKeditor:

1. Install Drupal application. http://drupal.org/download;

2. Add CKEditor module.  http://drupal.org/project/ckeditor
To use CKEditor in Drupal, you will need to download CKEditor (CKEditor 3.1 or greater is recommended). But the version 3.5 has errors (I couldn't make working my plugin) and I use ckeditor_3.3.1.
http://ckeditor.com/download/releases;

3. Activate CKEditor for edit. http://jesox.com/posts/how-install-and-configure-ckeditor-module;

4. Download fMath Editor plugin for CKEditor from http://www.fmath.info/download/plugins/ and unzip.

5. Copy the folder fmath_formula to drupal_folder/sites/all/modules/ckeditor/plugins;

6. Add fmath_formula plugin to drupal_folder/sites/all/modules/ckeditor/ckeditor.config.js
...
if (Drupal.settings.ckeditor.linktocontent_menu) {
config.extraPlugins += (config.extraPlugins ? ',linktomenu' : 'linktomenu' );
}
config.extraPlugins += (config.extraPlugins ? ',fmath_formula' : 'fmath_formula' );

...

config.toolbar_DrupalFiltered = [
['Source'],
['Cut','Copy','Paste','PasteText','PasteFromWord','-','SpellChecker', 'Scayt'],
['Undo','Redo','Find','Replace','-','SelectAll','RemoveFormat'],
['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar'],
['Maximize', 'ShowBlocks'],
'/',
['Format'],
['Bold','Italic','Underline','Strike','-','Subscript','Superscript','-','fmath_formula'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiRtl','BidiLtr'],
['Link','Unlink','Anchor','LinkToNode', 'LinkToMenu'],
['DrupalBreak', 'DrupalPageBreak']
];

...

//CKEDITOR.plugins.addExternal('imce', Drupal.settings.ckeditor.module_path + '/plugins/imce/');
CKEDITOR.plugins.addExternal('fmath_formula', Drupal.settings.ckeditor.module_path + '/plugins/fmath_formula/');
};

7. Don't forget to change/add in configMathMLEditor.xml the property urlGenerateImage with your server:
<property id="urlGenerateImage">http://localhost/capture/imageCapture.jsp</property>


thank you
alex

1 comment:

Sheshadri said...

Doesn't work on latest ckeditor module ..