You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/development/addon-development-overview.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,6 +199,8 @@ The `Model` folder holds all models that we are creating with our add-on.
199
199
The `widgets` folder holds all dashboard widgets we create with our add-on.
200
200
201
201
## A Word About Legacy Add-On Development
202
-
In the past, add-ons were often categorized based on their functionality. We identified our add-on to ExpressionEngine as a fieldtype, extension, module, or plug-in. Thus there was never a straightforward process on structuring one add-on that contained all these categories in one. With the release of 6.4.x and 7.2.x this has been updated. The CLI has been updated to make creating add-ons and adding functionality incredibly easy. At the same time, the docs have also been updated to reflect the ideal workflow of creating an add-on.
202
+
In the past, add-ons were often categorized based on their functionality. We identified our add-on to ExpressionEngine as a fieldtype, extension, module, or plug-in. Thus there was never a straightforward process on structuring one add-on that contained all these categories in one.
203
203
204
-
While the latest changes shift our view of add-ons and how developers will create add-ons, you may still come across add-ons using the old methodology. We have left much of the old methods and structure in place so that older add-ons will continue to work. However, we are choosing to not actively update the documentation for the old methods because we feel it's no longer in the best interest of the community to develop add-ons in this way. If you need to access how the docs once were regarding add-ons, you can reference the [legacy docs in GitHub](https://github.com/ExpressionEngine/ExpressionEngine-User-Guide/releases/tag/legacy-add-on-structure) (note that v7 and v6 were the same in these regards).
204
+
With the release of 6.4.x and 7.2.x this paradigm has been updated to reflect the idea that we are just creating add-ons, and those add-ons can have multiple types of functionality. The CLI has also been updated to make creating add-ons and adding functionality incredibly easy. We have also updated the docs to reflect the ideal workflow of creating an add-on.
205
+
206
+
While the latest changes shift our view of add-ons and how developers will create add-ons, you may still come across add-ons using the old methodology. We have left much of the old methods and structure in place in the core so that older add-ons will continue to work. However, we are choosing to not actively update the documentation for the old methods because we feel it's no longer in the best interest of the community to develop add-ons in this way. If you need to access how the docs once were regarding add-ons, you can reference the [legacy docs in GitHub](https://github.com/ExpressionEngine/ExpressionEngine-User-Guide/releases/tag/legacy-add-on-structure) (note that v7 and v6 were the same in these regards).
Copy file name to clipboardExpand all lines: docs/development/tab-files.md
+57-9Lines changed: 57 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,25 +14,73 @@ lang: php
14
14
15
15
# Adding Publish Layout Tabs
16
16
17
+
18
+
## Overview
17
19
Add-ons can also add tabs which are visible on in [Publish Layouts](control-panel/channels.md#publish-layouts). Respectivley these tabs would also be visible on the Entry Publish/Edit page if selected in the publish layout. Two things are required for your add-on to have this functionality:
18
-
-[`tabs()` method](/development/add-on-update-file.md#add-publish-tabs-with-your-add-on-tabs)addded to the Update File
20
+
-[`tabs()` method](/development/add-on-update-file.md#add-publish-tabs-with-your-add-on-tabs)added to the Update File
19
21
- The Tab File (`tab.[addon_name].php`)
20
22
21
-
## The Tab File (`tab.module_name.php`)
23
+
Here is an example of the publish layout's tab for the Structure add-on:
24
+

22
25
23
-
**class `Add_on_name_tab`**
26
+
## Creating The Tab File
27
+
Tab files are not currently able to be generated through the CLI, thus you will need to manually create the file `tab.[addon_name].php` in the root of your add-on's folder.
24
28
25
-
To add Publish Tabs
29
+
```
30
+
amazing_add_on
31
+
...
32
+
┣ tab.amazing_add_on.php
33
+
┗...
34
+
```
26
35
27
-
There are no required class variables. Because multiple modules may be adding fields to the publish page, all third party tab fields are namespaced using the package name when displayed on the publish page. This namespacing will be stripped prior to any data being returned to the tab functions.
36
+
## The Tab File Structure
28
37
29
-
NOTE: **Note:** if your module includes a tab, do not forget to indicate this in the update file when installing the module. Further, be sure to include the `tabs()` function in the update file, and use it when updating custom layouts on installation and uninstallation.
38
+
```
39
+
<?php
40
+
41
+
class Amazing_add_on_tab
42
+
{
43
+
44
+
public function display($channel_id, $entry_id = ''){
45
+
46
+
$settings = [
47
+
//array of settings
48
+
]
49
+
return $settings;
50
+
}
51
+
52
+
public function validate($entry, $values){
53
+
$validator = ee('Validation')->make(array(
54
+
'amazing_field_one' => 'required',
55
+
'amazing_field_two' => 'required|enum[y,n]',
56
+
));
57
+
58
+
return $validator->validate($values);
59
+
}
60
+
61
+
public function cloneData($entry, $values){
62
+
63
+
return $values;
64
+
}
30
65
31
-
## Tab File Function Reference
66
+
public function save($entry, $values){
67
+
68
+
}
69
+
70
+
public function delete($entry_ids){
71
+
72
+
}
73
+
32
74
33
-
**class `Module_name_tab`**
75
+
}
76
+
```
77
+
78
+
**class `Add_on_name_tab`**
79
+
80
+
There are no required class variables. Because multiple modules may be adding fields to the publish page, all third party tab fields are namespaced using the package name when displayed on the publish page. This namespacing will be stripped prior to any data being returned to the tab functions.
81
+
82
+
NOTE: **Note:** if your module includes a tab, do not forget to indicate this in the update file when installing the module. Further, be sure to include the `tabs()` function in the update file, and use it when updating custom layouts on installation and uninstallation.
Copy file name to clipboardExpand all lines: docs/development/widgets.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,11 +11,14 @@
11
11
12
12
[TOC]
13
13
14
-
Along with the basic widgets which will come native with ExpressionEngine Pro, each third-party add-on can provide multiple widgets to show pertinent information to users.
14
+
Along with the basic widgets which will come native with ExpressionEngine, each third-party add-on can provide multiple widgets to show pertinent information to users.
15
15
16
-
Widgets which are shipped with add-ons can have `.html` or `.php` extension and have to be placed into `widgets` sub-directory of the add-on. They are then installed automatically when the add-on is installed or updated.
16
+
Widgets which are shipped with add-ons can have `.html` or `.php` extension and have to be placed into `widgets` sub-directory of the add-on. They are then installed automatically when the add-on is installed or updated. When using the CLI to generate a widget, a PHP widget will be created.
17
17
18
-
Users can also create widgets using ExpressionEngine template manager.
18
+
TIP:Users can also create widgets using ExpressionEngine template manager without needing to create an add-on.
19
+
20
+
Here is an example of the Dashboard Widget shipped with the SEEO add-on:
0 commit comments