Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed docs/_images/add-on-html-string.png
Binary file not shown.
Binary file removed docs/_images/add-on-main-body.png
Binary file not shown.
Binary file removed docs/_images/add-on-mcp.png
Binary file not shown.
Binary file removed docs/_images/add-on-simple-view.png
Binary file not shown.
Binary file removed docs/_images/add-on-view.png
Binary file not shown.
Binary file removed docs/_images/addon_breadcrumbs.png
Binary file not shown.
Binary file removed docs/_images/addon_page.png
Binary file not shown.
Binary file removed docs/_images/addon_sidebar_start.png
Binary file not shown.
Binary file removed docs/_images/addon_toolbar.png
Binary file not shown.
Binary file removed docs/_images/addons_text_formatting.png
Binary file not shown.
Binary file removed docs/_images/dashboard_widget_example.png
Binary file not shown.
Binary file removed docs/_images/gear_icon.png
Binary file not shown.
Binary file removed docs/_images/prolet_example.png
Binary file not shown.
Binary file removed docs/_images/structure_tab.png
Binary file not shown.
42 changes: 2 additions & 40 deletions docs/add-ons/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,14 @@

# Add-Ons

[TOC]

## Overview
Add-ons can extend the functionality of ExpressionEngine, adding more features, fields, template tags, and more!

![add-on manager](_images/addon_page.png)

There are three main sources of add-ons for ExpressionEngine:

- Add-ons that are shipped with ExpressionEngine (found in the `Add-ons` section of the Control Panel)
- Add-ons that are downloaded from an outside resource such as the [ExpressionEngine Add-on Store](https://expressionengine.com/add-ons) or other developers.
- Add-ons that you create yourself (see [Add-on Development](/development/addon-development-structure.md) for more information on creating your own add-ons).

Add-ons that are not shipped with ExpressionEngine or created by the ExpressionEngine team are typically referred to as "third-party add-ons."

TIP: Visit the [Add-on Store](https://expressionengine.com/add-ons) to browse available add-ons.


Visit the [Add-on Store](https://expressionengine.com/add-ons) to browse available add-ons.

## Installing Add-ons

Installing an add-on is easy!

1. Download the add-on and unzip its contents.
2. Upload the add-on's folder to your `/system/user/addons/` folder. If needed, also copy any themes to you `/themes/user/` folder.
2. Upload the add-on's folder to your `system/user/addons/` folder.
3. Once the add-on is uploaded, you should see it listed in the [Add-on Manager](control-panel/addons-manager.md) in your ExpressionEngine Control Panel. You can then click install!

NOTE: Some add-ons include a `themes` folder. This folder includes supporting styles and scripts to help the add-on function properly. Add-on themes should be copied to the `themes/user/` folder.

## Updating Add-ons

Updating an installed add-on is just as easy as installing.

1. Download the add-on and unzip its contents.
2. Overwrite any older versions of the add-on that may be in place by upload the add-on's folder to your `/system/user/addons/` folder. If needed, also copy and overwrite any themes to you `/themes/user/` folder.
3. Once the add-on is uploaded, you will see it listed in the "Updates" tab of the [Add-on Manager](control-panel/addons-manager.md) in your ExpressionEngine Control Panel. You can then click the Update button to update your add-on to its newest version!

TIP: Some add-ons may notify you in the Add-on Manager that there is an upload available for download. Others you will have to check with the add-on vendor to determine if a newer version is available.

## Uninstalling Add-ons

Follow these steps to ensure an installed add-on is properly removed from your site.

1. In the Add-on Manager, select the gear icon ( <img style="margin-bottom: 0px; vertical-align: middle; display:inline-block;" src="../_images/gear_icon.png" alt="gear icon"> ) next to your add-on.
2. Select Uninstall from the flyout menu options.
3. Follow the prompts to uninstall your add-on.

After you have uninstalled your add-on, you may then delete it's folder from your filesystem if you no longer need it.

2 changes: 0 additions & 2 deletions docs/cli/built-in-commands/make-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@ Action Generator -- Creates a new action for an add-on
### Generating an action:

`php eecli.php make:action MyNewAction --addon=my_existing_addon`

TIP: For more information on using the `make:action` command to create new action, reference [Adding Actions](development/actions.md).
63 changes: 60 additions & 3 deletions docs/cli/built-in-commands/make-addon.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,34 @@ Check out our video tutorial generating an add-on!
## Options list:

```
--extension
--ext
Create an extension

--plugin
--pi
Create a plugin

--fieldtype
--ft
Create a fieldtype

--module
--mod
Create a module

--typography
-t
Should use plugin typography

--has-settings=<value>
-e <value>
Add-on has settings (yes/no)

--compatibility-mode
-p
Generate add-on that is compatible with ExpressionEngine versions lower than 7.2.0 and lower than 6.4.0

--version=<value>
-v <value>
Version of the add-on
Expand All @@ -26,14 +54,43 @@ Check out our video tutorial generating an add-on!
-u <value>
Author url of the add-on

--services=<value> [--services=<value> [...]]
-s <value> [-s <value> [...]]
Services to create. Multi-pass option.

--models=<value> [--models=<value> [...]]
-m <value> [-m <value> [...]]
Models to create. Multi-pass option.

--commands=<value> [--commands=<value> [...]]
-c <value> [-c <value> [...]]
Commands to create. Multi-pass option.

--consents=<value> [--consents=<value> [...]]
-n <value> [-n <value> [...]]
Consents. Multi-pass option.

--cookies=<value> [--cookies=<value> [...]]
-k <value> [-k <value> [...]]
Cookies to create, with a colon separating name and value (i.e. name:value). Multi-pass option.

--hooks=<value> [--hooks=<value> [...]]
-o <value> [-o <value> [...]]
Hooks in use. Multi-pass option.

```

## Examples:

### Generating an add-on:
### Generating an extension:

`php eecli.php make:addon example_extension --ext --description "Description of addon" --version="1.0.0" --author="Joe Shmoe" --author-url='www.example.com' --has-settings='yes' --hooks=cp_custom_menu`

### Generating a module:

`php eecli.php make:addon my_awesome_mod --mod --description "Description of addon" --version="1.0.0" --author="Joe Shmoe" --author-url='www.example.com' --has-settings='yes'`

### Generating a module in compatibility mode:

`php eecli.php make:addon amazing_add_on --description "Description of addon" --version="1.0.0" --author="Joe Shmoe" --author-url='www.example.com'`
`php eecli.php make:addon my_awesome_mod --mod --description "Description of addon" --version="1.0.0" --author="Joe Shmoe" --author-url='www.example.com' --has-settings='yes' --compatibility-mode`

TIP: For more information on using the `make:addon` command to create new add-on, reference [Getting Started](development/addon-development-overview.md#getting-started) in the Building An Add-On section of the docs.
2 changes: 0 additions & 2 deletions docs/cli/built-in-commands/make-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@ Command Generator -- Creates a new CLI command for an add-on
### Generating a command:

`php eecli.php make:command "Awesome CLI Command" --addon=my_example_addon --description='This command is awesome' --signature='my_addon:awesome-example'`

TIP: For more information on using the `make:command` command to create new CLI command with your add-on, reference [Adding CLI Commands](cli/creating-a-command.md).
2 changes: 0 additions & 2 deletions docs/cli/built-in-commands/make-extension-hook.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@ Extension Hook Generator -- Implements an EE extension hook in an add-on
### Implementing the sessions_start extension hook:

`php eecli.php make:extension-hook sessions_start --addon=my_existing_addon`

TIP: For more information on using the `make:extension-hook` command to create new action, reference [Extending The Core](development/extensions.md).
2 changes: 0 additions & 2 deletions docs/cli/built-in-commands/make-prolet.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,3 @@ Prolet Generator -- Creates a new prolet for an add-on
### Generating a prolet:

`php eecli.php make:prolet MyNewProlet --addon=my_addon --description="This is my prolet description"`

TIP: For more information on using the `make:prolet` command to create new Prolet with your add-on, reference [Adding Prolets](development/prolets.md).
6 changes: 2 additions & 4 deletions docs/cli/built-in-commands/make-tag.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# make:template-tag
# make:tag

Tag Generator -- Creates a new tag for an add-on

Expand All @@ -14,6 +14,4 @@ Tag Generator -- Creates a new tag for an add-on

### Generating a new tag:

`php eecli.php make:template-tag MyNewTag --addon=my_existing_addon`

TIP: For more information on using the `make:template-tag` command to create new template tag with your add-on, reference [Adding Template Tags](development/custom-template-tags.md).
`php eecli.php make:tag MyNewTag --addon=my_existing_addon`
2 changes: 0 additions & 2 deletions docs/cli/built-in-commands/make-widget.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ Widget Generator -- Creates a new Dashboard Widget for an add-on
### Generating a widget:

`php eecli.php make:widget MyNewWidget --addon=my_existing_addon`

TIP: For more information on using the `make:widget` command to create new Dashboard Widget with your add-on, reference [Adding Dashboard Widgets](development/widgets.md).
126 changes: 20 additions & 106 deletions docs/cli/creating-a-command.md
Original file line number Diff line number Diff line change
@@ -1,118 +1,32 @@
# Creating a CLI Command
# Creating a Command

[TOC]
Commands are created to live within add-ons, and are registered as part of the add-on process.

## Overview
The ExpressionEngine [Command Line Inferface (CLI)](/cli/intro.md) makes it simple and more efficent to do many things inside of ExpressionEngine. In fact, if you're following the docs to build your own custom add-on then you're probably using the CLI to build out the architecture of your add-on.
## addon.setup.php

You can also build your own commands that will enable users to interact with your add-on or do other things inside of ExpressionEngine. Commands are created to live within add-ons, and are registered as part of the add-on process.

NOTE:Before adding a custom CLI Command to your add-on, you need to already have an add-on in place. See [Building An Add-On: Getting Started](development/addon-development-overview.md#getting-started) for how to generate the starter files for your add-on.

## Creating An Amazing Command
We add custom commands to the CLI when our add-on is installed by using the CLI.

```
php system/ee/eecli.php make:command
```

Follow the prompts to add a CLI command to your add-on.

This will create a `Commands` folder in your add-on along with a class and file based on your command name.
In order to add commands to your addon, you should add the `commands` parameter as an associative array to your `addon.setup.php` file with the handle as the key, and the class of your command as the value.

```
amazing_add_on
┣ Commands
┃ ┣ Command[CommandName].php
return array(
'author' => 'Awesome Developer',
'author_url' => 'https://example.com/',
'name' => 'My Amazing Module',
'description' => 'Does amazing things',
'version' => '1.0',
'namespace' => 'Awesome\AmazingModule',
'settings_exist' => true,
'commands' => [
'amazing:run' => Awesome\AmazingModule\Commands\DoThings::class,
'amazing:more-things' => 'Awesome\AmazingModule\Commands\DoMoreThings',
]
);
```

CLI Commands are installed through an add-on's `addon.setup.php` file. The CLI takes care of this for us. We can see here that CLI creates the `$commands` array inside the array that gets returned from our `addon.setup.php` file.

```
<?php

return [
'author' => 'Expressionengine Developer',
'author_url' => 'https://www.expressionengine.com',
'name' => 'Amazing Add-on',
'description' => 'asdfjasdf',
'version' => '1.0.0',
'namespace' => 'ExpressionengineDeveloper\AmazingAddon',
'settings_exist' => true,
'commands' => [
'amazing_add_on:make:amazing-things' => ExpressionengineDeveloper\AmazingAddon\Commands\CommandAnAmazingCommand::class,
],

],

];

```

Now when our add-on is installed, users will have access to our new command.

## Anatomy of a Command - `/Commands/Command[CommandName]`
Inside of our add-on we now have a file named with our command's name (in PascalCase).

In this example we have created a new command named "An Amazing Command" to our Amazing Add-on:

```
<?php

namespace ExpressionengineDeveloper\AmazingAddon\Commands;

use ExpressionEngine\Cli\Cli;

class CommandAnAmazingCommand extends Cli
{
/**
* name of command
* @var string
*/
public $name = 'an amazing command';

/**
* signature of command
* @var string
*/
public $signature = 'amazing_add_on:make:amazing-things';

/**
* Public description of command
* @var string
*/
public $description = 'This command does amazing things';

/**
* Summary of command functionality
* @var [type]
*/
public $summary = 'This command does amazing things';
It is best practice to namespace your commands, so as not to conflict with other addons.

/**
* How to use command
* @var string
*/
public $usage = 'php eecli.php amazing_add_on:make:amazing-things';
## Anatomy of a Command

/**
* options available for use in command
* @var array
*/
public $commandOptions = [

];

/**
* Run the command
* @return mixed
*/
public function handle()
{
$this->info('Hello World!');
}
}
```
Creating commands is simple. Each commands is built in a similar way as part of a custom add-on:

### Class Structure

Expand Down
6 changes: 3 additions & 3 deletions docs/cli/intro.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Command Line Interface (CLI)
# Command Line Inferface (CLI)

The Command Line Interface (CLI) allows a user to run system and user-generated commands in the terminal. The CLI has access to all of the ExpressionEngine resources, and can be used to update the system, clear caches, and much more.
The Command Line Inferface (CLI) allows a user to run system and user-generated commands in the terminal. The CLI has access to all of the ExpressionEngine resources, and can be used to update the system, clear caches, and much more.

By default the CLI is located `system/ee/eecli.php` .

Expand All @@ -18,7 +18,7 @@ By default the CLI is located `system/ee/eecli.php` .
- [make:migration - Creates a new migration](cli/built-in-commands/make-migration.md)
- [make:model - Creates a new model for an add-on](cli/built-in-commands/make-model.md)
- [make:prolet - Creates a new prolet for an add-on](cli/built-in-commands/make-prolet.md)
- [make:template-tag - Creates a new tag for an add-on](cli/built-in-commands/make-tag.md)
- [make:tag - Creates a new tag for an add-on](cli/built-in-commands/make-tag.md)
- [make:widget - Generates widgets for existing add-ons](cli/built-in-commands/make-widget.md)
- Migrate
- [migrate - Runs specified migrations (all, core, or add-ons)](cli/built-in-commands/migrate.md)
Expand Down
4 changes: 1 addition & 3 deletions docs/control-panel/addons-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@

# Add-On Manager

**Control Panel Location: `Add-Ons`**
**Control Panel Location: `Developer > Add-Ons`**

This section of the Control Panel is where add-on functionality is installed, updated, configured, and removed. They can be filtered by status and developer, and sorted by the add-on name and version. This section is divided into to sections, one for add-on functionality included with ExpressionEngine, and one for third party add-ons.

![add-on manager](_images/addon_page.png)

See [Installing Add-ons](add-ons/overview.md#installing-add-ons) to learn how to install an add-on.
Loading