Skip to content

Preparing your v1.x plugins for v2.x

CaMer0n edited this page Mar 16, 2013 · 8 revisions

Plugins developed for v1.x of e107 will continue to work on v2.x. However, to get the most out of v2.x, we suggest the following changes be made to bring your plugin up to the new v2.x standards.

Front-end

HTML & Css

e107 v2.x follows the bootstrap standard for css. As a quick reference:

  • <input class='button' should become <input class='btn button'
  • <table class='fborder' should become <table class='table fborder'
  • Html <table> which use the class 'fcaption' on <td>, change the <td> to <th>

Templates

e107 v2.x uses a new template loading system. Plugin templates should be stored in e107_plugins/yourplugin/templates/ by default. The template file should contain a variable with the same name as your template file.

eg. If your file is called myplugin_template.php , within this file you might see something like this:

$MYPLUGIN_TEMPLATE['start'] = "<div>";
$MYPLUGIN_TEMPLATE['end'] = "</div>";

Admin-Area

The admin area of v2.x uses a special new admin handler (admin-ui).

In v2.x under 'Plugin Manager' you will find something called 'Plugin Builder'. It allows you to select your e107 _sql file from your plugin folder and will generate most of the new code for the admin-area of your plugin. It will also generate the new plugin.xml meta-file, which is used during installation of your plugin.

The advantages of using the new admin system are numerous - including, but not limited to:

  • No need to code in the HTML or the process of reading or writing to your database.
  • Consistent interface with the rest of admin
  • Users can select which fields from your db table they wish to view - based on your predefined list.
  • Media-Manager is integrated into the system.
  • Easily add drag and drop sorting/re-ordering to your plugin.
  • Easily add batch delete, copy, featurebox creation, sitelink creation, userclass modification, etc. etc.
  • Easily add inline editing to your data.
  • Easily add tabs to keep your plugin's admin-area well organized.
Clone this wiki locally