Editor Documentation

Editor Documentation

Installation and Updating

Installing

  1. Within the /system/expressionengine/third_party/ directory, copy the editor folder into your sites ./system/expressionengine/third_party/ directory.
  2. Within the /themes/third_party/ directory, copy the editor folder into your sites./themes/third_party/ directory.
  3. Go to the Modules area in the ExpressionEngine control panel, find Editor in the list, and click Install.

Updating

  1. Within your sites ./system/expressionengine/third_party/ directory, delete the editor folder and upload the new one from the /system/expressionengine/third_party/ directory in your download package.
  2. Within your sites ./themes/third_party/ directory, delete the editor folder and upload the new one from the /themes/third_party/ directory in your download package.
  3. Go to the Modules area in the ExpressionEngine control panel and click the Run Module Updates button.

Config Overrides

All settings in Editor can be set in the config.php file. These settings will override settings stored in the DB and will prevent them from being changed (form input will be disabled).

$config['editor']['s3']['aws_access_key'] = '';
$config['editor']['s3']['aws_secret_key'] = '';

Custom Editor Buttons

Class properties & methods

In addition to the class and function, you should also add some information that will display in the Button Manager.

$info array

The information is as follows:

name: The display name of the button
version The button version number
author:: The name of the button author
author_url: The URL associated with the author (or a URL to a page about the Button)
description: A short description of the purpose of the Button
settings: (bool) Does this button have any settings?
callback: Javascript Callback that gets called when the button is pressed. Leave empty or BOOL false to use Dropdowns instead
button_css: (optional) Button CSS. Example base64encoded background image: background-image: url(data:image/png;base64,fooooo);
button_css_hq: (optional) Button CSS High Quality (for retina displays)

__constructor()

$this->EE =& get_instance(); is already called for you in the parent constructor. $this->settings is also automatically mapped for you.

display()

If present, this method gets called while preparing the Editor HTML output. Return any HTML you would like to be included. Here you can also call the css/js helper method in case you need to include any css/js on the page.

Example use jquery plugin: $this->css_js(‘js’, ‘url’, URL_TO_PLUGIN, ‘jquery’, ‘colorpicker’);
Example use inline css: $this->css_js(‘css’, ‘inline’, $inline_css, ‘mybutton’, ‘main’);

display_settings()

Render your settings page. Return valid HTML. Do not include a <form> element, this has already been done for you.

save_settings()

Return a valid array

A button consists of a class and at least one function:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// File: editor.mybtn.php
 
class Mybtn_ebtn extends Editor_button
{
        /**
         * Button info - Required
         *
         * @access public
         * @var array
         */
        public $info = array(
        'name'          => 'Button Label',
        'author'        => 'Author',
        'author_url'    => 'Author URL',
        'description'   => 'Button Description',
        'version'       => 'Version Number',
        'settings'      => FALSE,
        'callback'      => 'JS Callback',
        'button_css'    => '',
        'button_css_hq' => '',
    );
 
        /**
         * Constructor
         *
         * @access public
         *
         * Calls the parent constructor
         */
        public function __construct($settings=array())
        {
                parent::__construct($settings;
        }
 
        // ********************************************************************************* //
}

Support

Having problems setting up and/or using Editor? Support is offered from 10am to 4pm EST weekdays. Send us an email at help@eeharbor.com and we will respond as quickly as we can.