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
1.Create a `jump.[addon_name].php` file in your add-on folder
20
+
Create a `jump.[addon_name].php` file in your add-on folder
21
21
22
-
2.Your jump file MUST have the following:
22
+
Your jump file MUST have the following:
23
23
24
24
use ExpressionEngine\Service\JumpMenu\AbstractJumpMenu;
25
25
26
26
class [AddonName]_jump extends AbstractJumpMenu
27
27
{
28
28
29
-
protected static $items = [];
29
+
protected static $items = array(
30
+
'commandArrayTitle' => array(
31
+
'icon' => 'fa-file',
32
+
'command' => 'few lowercase words to be fuzzy-matched in jump menu',
33
+
'command_title' => 'Displayed <b>command title upon match from above</b>',
34
+
'dynamic' => false,
35
+
'requires_keyword' => false,
36
+
'target' => 'See Below. Behavior changes based on dynamic element above'
37
+
));
30
38
31
-
3. Add commands for your custom items.
32
-
Item commands are comprised of the following:
39
+
To Add Jump Menu commands to your add-on, you simply add array elemnts to the $items array in the example above
33
40
34
-
-`[commandTitle]`_(string)_ Unique command title used as key in global jumps array. Will be prefixed with `[addonName]:` so a command title in Assets of `editS3Source` will be `Assets:editS3Source`
41
+
The array of a Jump Menu command is comprised of the following keys:
42
+
43
+
-`commandArrayTitle`_(string)_ Unique command title used as key in global jumps array. Will be prefixed with the add-ons name so a command title in the add-on Assets of `editS3Source` will be `Assets:editS3Source`
-`command_title`_(string)_ Human-readable command title, shows up in results
45
+
-`command` )_(string)_ lowercase string to be fuzzy-matched when user is typing in jump menu: “edit external source”
46
+
-`command_title`_(string)_Language file array key for Human-readable command title, shows up in results if fuzzy-matched. *Please note, this should be in your Lang file.
38
47
39
48
NOTE: Style Note: We use bold, italics, and brackets to denote keywords and actions to the user and urge you to use keep your commands in line with this style:
-`dynamic`_(bool)_ default: false, whether your command has secondary results
51
+
52
+
53
+
-`dynamic`_(bool)_ default: false, sets whether your command has secondary options in the jump menu
43
54
-`requires_keyword`_(bool)_ default: false, Used in conjunction with `dynamic`. Whether your command requires additional keywords to return results or not. An example of a `false` would be returning a list of channels. An example of `true` would be returning entries where you don’t want to prematurely return them before the user enters something to filter by.
44
-
-`target` (string)
55
+
-`target` (string) Can NOT be to an external link
45
56
- If `dynamic` == true: method name in your add-on’s jump file that will be called. Will be passed an array of search keywords.
46
57
- If `dynamic` == false: method name to redirect the user to in your add-on (ex: settings/license)
47
58
48
59
NOTE: This is currently hard-coded to `addons/settings/[addon_name]/X` but will most likely be changed to allow any CP URL path.
49
60
61
+
In addition to the required array elements above. There are also the following array element that is optional.
62
+
```
63
+
'permission' => 'ban_users'
64
+
65
+
```
66
+
-`permission`_(string)_ ExpressionEngine Role permissions that has to be matched for a user to see this jump menu command.
0 commit comments