Solution: Spell Checking Content Using eZ publish Online Editor and Firefox

Submitted By: Graham Brookins

Brief: Firefox + eZ publish + Online Editor + Spellcheck Plugin

If you manage an website powered by eZ publish, one of the first questions that becomes a regular occurrence; Is my content spelled correctly. The answer is found in a process which ensures that content has been read not just passed on without a quality control process. A process like being reviewed for comprehension, spelling, crammer, readability, continuity, clarity, accuracy and quality by an editor.

I love the eZ publish Online Editor! Now I know what your thinking, what about all that nay saying from people who say $99 for a javascript gui editor designed specifically for an enterprise cmf/cms system! It’s too much, It’s not enough, it’s not free (as in free beer)! I say, take another look at the eZ publish Online Editor v2.0. The new 2.0 supports both Internet Explorer (existing) and Mozilla/Gecko (new) based browsers. I even heard that there are some eZ publish hosting companies which provides a free copy of the online editor for use on your eZ publish installation.

I just recently was given the opportunity to try it and I was blown away. Not only does it work in Firefox but combined with other Firefox extensions, Managing eZ publish content has never been more efficient and quick. Upon installing a the Firefox Plugin SpellBound and a Dictionary, I found that any form field, including eZ publish forms and could be spell checked quickly and simply.

Before this I would edit all my content in a hand text editor and spell checked before posting for reliability and avoid browser page session timeouts, crashes, or other accidents by only posted content through an editor process, cause it works well.

Still being able to combine Firefox with the online editor could make my smaller less important content additions / changes spelled accurately much quicker.

Problem

Missing Client Side, Spell Check from OE / eZ publish

Solution

Use a browser plugin to provide spell checking within the browser itself, for which all content to the website passes through.

Directions

  1. Install Firefox
  2. Install the SpellBound Plugin, a Dictionary for your region,
  3. Restart Firefox. !Voila

Problem

The 'Context Menu' in OE prevents use of firefox right click menu features / items.

  • Unfortunately, It’s true, the Online Editor Appears to lack the a browser side feature to control / allow the use of a browsers right click menu inside of an eZ xml text field with a default installation of the Online Editor. Nor does it provide a client side feature enable or disable this behavior on a per session or instance basis. Which prevents the use of a many browser plugins / features when you right click inside of an eZ xml text field and the editor is enabled.

Solution

Disable the eZ publish OE Right Click Context Menu (permanently in the source code)

Simply edit this file 'ezmozillaeditor.js' located in your eZ publish installation at 'extension/ezdhtml/design/standard/javascripts/ezdhtml/'

  • Change these lines:
editorDoc.addEventListener( "contextmenu", disableDefaultContextMenu, false );
    editorDoc.addEventListener( "mousedown", removeContextMenu, false);
    editorDoc.addEventListener("contextmenu", function(){showContextMenu(editorID,indexDir,objectID,objectVersion);}, false);
  • Comment them out / Change them to:
/*
    editorDoc.addEventListener( "contextmenu", disableDefaultContextMenu, false );
    editorDoc.addEventListener( "mousedown", removeContextMenu, false);
    editorDoc.addEventListener("contextmenu", function(){showContextMenu(editorID,indexDir,objectID,objectVersion);}, false);
*/

An other perhaps more flexible alternative would be to add a setting in the oe extension to support a per installation setting configuration which could enable or disable a feature similar to this for greater flexibility in the implementation. Yet a better solution would be to offer a per session configuration in the oe which could enable or disable the oe menu with a click of a button and or a keyboard shortcut + right click which could allow per click choice to allow the suppression of the oe’s context sensitive right click menu and allow the browser’s menu to be used in it’s stead.

editorDoc.addEventListener( "contextmenu", disableDefaultContextMenu, true );
    editorDoc.addEventListener( "mousedown", removeContextMenu, true);
    editorDoc.addEventListener("contextmenu", function(){showContextMenu(editorID,indexDir,objectID,objectVersion);}, true);

Hint, Hint, Article Ideas: