Aloha Editor and WordPress

This is a short update on a post I wrote back in August 2010 – Aloha Editor, content editing the HTML5 way. When I last looked at the project there were some excellent examples of it working on static pages but no real integration into back-end systems had taken place. As with any open-source project things progress quickly; on the 5th June a plug-in called Front-end Editor for WordPress was updated to include Aloha Editor! You can now edit blog posts directly in the page rather than through the administration panel. The plug-in is a joint effort from authors Jotschi and Scribu, excellent work guys.

Aloha Editor in WordPress using Front-end Editor
Edit a post directly in the page, the future is here.

Now I’d love to show you a picture of it working in my blog template, but that would be too easy wouldn’t it. :) Unfortunately the plug-in doesn’t work with my custom theme, I’m yet to figure out the reason why. Boo! I know it isn’t a plug-in issue as it works with the default WordPress theme. This could be an issue for others wanting to use the plug-in, so as soon as I figure out why I’ll post an update.

One issue I did notice was Aloha likes to use its own version of jQuery; manually including it in your theme will cause Aloha to throw an error. A quick workaround is to wrap a WordPress conditional tag around the jQuery script element like so:

    //If you aren't logged in, include jQuery
    if(!is_user_logged_in()) {
        //Insert jQuery script tag here

Since you need to be logged in for Aloha to be initialised this will fix the error and allow you to use the latest version of jQuery in your theme.

As soon as I fix Front-End Editor for my current theme I’m sure it will be one of my favourite plug-ins. Last but not least a big thank you to the Aloha Editor team, I’m looking forward to seeing how the project progresses.