Back to Start Page
How to add a side menu item to a plugin
Here are the steps to take:
- Go to the plugin folder to add the menu item to. Let's assume this plugin is created by “pds” and the name of the plugin is 'library'. So the plugin is to be found at [path to octobercms]/plugins/pds/library/
- Here you will find (hopefully) the Plugin.php. Open this file in your editor
- add a public function called boot() if it does not already exist (should be so)
<?php ... public function boot() { // Extend the backend side navigation for a plugin Event::listen('backend.menu.extendItems', function($manager) { // Pds.Library stands for author.pluginname // Library is the main entry for this plugin shown at the top menu $manager->addSideMenuItems('Pds.Library', 'Library', [ 'books' => [ 'label' => 'Books', 'icon' => 'icon-book', 'code' => 'side-menu-books', 'owner' => 'Pds.Library', 'url' => Backend::url('Pds/Library/Books'), ], ]); }); }