Topics

Admin menu

Admin menu is automatically generated out of all installed plugins. If you want your plugin to appear in admin menu list, add AdminController.php with following content

<?php

namespace Plugin\PluginName;


class AdminController
{
    public function index()
    {
          return '<h1>Administration of my plugin</h1>';
    }
}

If your plugin needs more than one menu item, add @ipSubmenu docblock directive as follow (available since 4.1.1)

<?php

namespace Plugin\MyPlugin;


class AdminController
{
    /**
     * @ipSubmenu Submenu1
     */
    public function index()
    {
        return '<h1>Administration of my plugin</h1>';
    }

    /**
     * @ipSubmenu Submenu2
     */
    public function submenu()
    {

    }
}

@ipSubmenu tells the system that this function has to be added to the submenu. Submenu1 and Submenu2 tels the title of submenu items. 

Advanced

If you need more power over the admin menu, you can catch ipAdminMenu and ipAdminSubmenu filters. These filters give you the menu as an array of \Ip\Menu\Item objects. Alter it in any way you like.

Hide admin menu

In some cases, you could like to hide the whole admin bar. To do so, add ?disableAdminNavbar=1 at the end of the URL.

Disable   widget management (since 4.5.2)

You can disable content management by adding ?disableManagement'=1 at the end of the URL. The user will stay logged-in, but won't see management tools in that particular page view.

comments powered by Disqus