Ankit Ahuja

Installing the Front End Editor Extension on Joomla 1.5

Many of you already know that I created the “Front End Editor” a.k.a ”Enhanced Front End Editing” extension for Joomla! as part of Google Summer of Code 2009. The extension only works in 1.5.x right now. Even though I tried to make it easy to adopt the extension by making it easy to setup, the extension does rely on the template quite a bit. I thought if I explain the installation process, all the hacks the extension makes and the underlying dependencies in a blogpost, it should help in getting rid of confusion to some degree.

You can download the extension from JED.

Installation

  1. Install com_frontendeditor, plg_frontendeditor and plg_articleeditor from here.

  2. Enable the plugins “System - Frontend Editor” and “Content - Frontend Article Editor”.

  3. Go to Components -> Enhanced Frontend Editor at the backend and click on Apply Changes. You can modify the settings there to suit your template and needs.

Hacks (applied when you click on Apply Changes)

  1. Adds the module chrome modChromefreditor to the html/modules.php file of the current template. Before doing this, it creates a backup file html/modules.php.backup.

  2. After creating a backup of index.php as index.php.backup, it modifies the following statements in the “index.php” of the current template:

    • All the jdoc statements get the style freditor.

      Example:

      <jdoc:include type='modules' name='top'>

      gets changed into

      <jdoc:include type='modules' name='top' style='freditor'>

    • Surrounds the jdoc statements with a div that has a class in the format frpos.position-name.

      Example:

      <jdoc:include type='modules' name='user3' style='freditor'>

      gets changed into

      <div class='frpos.user3'><jdoc:include type='modules' name='user3' style='freditor'></div>

    • Replaces the existing /html/com_content/article/form.php with a custom form.php, after creating a backup – form.php.backup.

The backup files are created so that you can undo the changes anytime by clicking on Revert Changes. You should revert the hack if you choose to uninstall the extension.

You’ll also need to apply the hack separately for each template you want to use.

Dependencies and Limitations

  • Mootools 1.2 Perhaps the biggest limitation of this extension is that it uses mootools 1.2 instead of 1.1 which is used in Joomla! 1.5. Consequently, some of your javascript that uses mootools 1.1 may not work properly when you’re logged in. Mootools 1.2 will only replace 1.1 when you’re logged in at the front-end and have the plugins enabled. The reason I chose 1.2 is that Joomla! 1.6 will use mootools 1.2.

  • Menu-item title editing The menu-item titles must be enclosed in LI elements with the class in format item<menu-id>. Example:

    <li class='item13'><span>Joomla! Documentation</span></li>

    If your template uses a different layout, you may want to modify it a little to support menu-item title editing. In case you don’t, you need not worry as each of these features degrade gracefully, without affecting the functionality or presentation of your site.

  • Default article edit icons are hidden The default edit icons are hidden and the extension displays its own edit icons. You can specify their selector in the admin component. In case your template uses a different selector than the default one and you don’t specify it, a pair of edit icons can appear for each article which will lead to confusion.

  • Selectors for article and page titles If they are not the default, you can modify them in the admin so that editing of article and page titles works.

Future Versions

You can report any bugs here. Since my college semester has now begun, any updates to the extension will probably come slowly. I plan to remove any trivial withstanding bugs, add new features with time and improve the extension in general. I would love to spend any free time in fixing bugs of the overall Joomla! project as well.

As far as Joomla! 1.6 is concerned, I did create a patch for 1.6 but due to time constraints, it wasn’t included in the feature-set for 1.6. So, when a stable version of 1.6 is released, I’ll port this extension to support 1.6.

I will love to know if the extension worked for you and any suggestions or feedback you want to give. You can either contact me via the Contact page or send me an @reply on Twitter.

Update

This is a common recurring problem for version 0.3.7 of the extension. If you’re getting the following error:

1
2
3
Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$'
in your-install/administrator/components/com_frontendeditor/controller.php
on line 99

it means you’re probably using a version of PHP earlier than 5. Unfortunately, this piece of code only works in PHP 5. You’ll either need to update to PHP 5 or get the patch from here. You’ll need to apply the patch to your-install/administrator/components/com_frontendeditor/controller.php.

In case you’re not familiar with applying a patch, you’ll have to execute the following command from the shell:

1
patch -p1 -i 99line.patch controller.php

If you’ve issues, even though I am not maintaining the extension, you can email me at ahuja DOT ankit AT gmail DOT com.