This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

Adam
Adam

Is it possible to extend another plugin's navigation?

I've added comment functionality to the RainLab blog plugin and want to add a comment moderation section in the backend. Logically it makes sense to show this on the existing blog navigation submenu, rather than having to create a new main menu item.

Any pointers?

alxy
alxy

Ok, I dont know if that works, but you could try to paste this to your Plugin.php: https://github.com/rainlab/blog-plugin/blob/master/Plugin.php#L30-L57 and then extend the sideMenu array. You jsut need to make sure , that your plugin is loaded after the rainlab one. No warranties.

Adam
Adam

Yeah I'd thought of something similar and have just tried it but it loads another blog menu along the top. That might be a plugin order thing. Is it possible to set the plugin load order?

My only other thought is to customise the RainLab plugin and disable updates? Not ideal but should work.

Shahiem
Shahiem

Yes, it is possible.

Try this :)

public function boot()
{
    Event::listen('backend.menu.extendItems', function($manager)
    {
       $manager->addSideMenuItems('RainLab.Blog', 'blog', [
            'comments' => [
                'label'       => 'Comment',
                'icon'        => 'icon-comments',
                'code'        => 'comments',
                'owner'       => 'RainLab.Blog',
                'url'         => Backend::url('author/pluginname/section')
            ],
        ]);

    });
}

Last updated

Adam
Adam

Shahiem that's great. Works perfectly! Thank you.

Shahiem
Shahiem

No problem ;)

1-6 of 6

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.