mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-11 15:56:06 +01:00
Call onAdminTemplateNavPluginHook to provide plugins the ability to populate plugins_hooked_nav
Example event handling:
public function onAdminTemplateNavPluginHook()
{
$this->grav['twig']->plugins_hooked_nav['PLUGIN_DATA.DATA'] =
['route' => 'data', 'icon' => 'fa-file-text'];
}
This commit is contained in:
@@ -223,6 +223,9 @@ class AdminPlugin extends Plugin
|
||||
$twig->twig_vars['base_path'] = GRAV_ROOT;
|
||||
$twig->twig_vars['admin'] = $this->admin;
|
||||
|
||||
// Gather Plugin-hooked nav items
|
||||
$this->grav->fireEvent('onAdminTemplateNavPluginHook');
|
||||
|
||||
switch ($this->template) {
|
||||
case 'dashboard':
|
||||
$twig->twig_vars['popularity'] = $this->popularity;
|
||||
|
||||
Reference in New Issue
Block a user