-
Notifications
You must be signed in to change notification settings - Fork 683
Closed
Labels
Description
Description
Attempting to allow my plugin to display as a navigation element in the CP area but I can't get it to work.
I used Redirect as a working example and I've included the code I borrowed below.
Plugin is installed and is working as it should. I can navigate to the CP index page but it will not display the icon and nav element in the sidebar.
I didn't see this anywhere in the docs (I could have missed it) so I'm posting here.
Steps to reproduce
- Germinated plugin scaffold from https://pluginfactory.io/
- Added the following code to the plugin:
use craft\events\RegisterCpNavItemsEvent; // ... public function getCpNavItem() { return [ 'url'=> 'pluginurl', 'label'=>Craft::t('plugin', 'Plugin'), 'icon' => 'icon' ]; }
Additional info
- Craft version: Craft CMS 3.0.0-beta.22
- PHP version: 7.0.15
- Database driver & version: MySQL 5.6.35
- Plugins & versions: This custom plugin, Redirect as an example