icedwater
icedwater

Reputation: 4887

How do I remove the CMS and Media buttons from the Backend interface?

I have many icons across the top of the page when I first log in on the backend. I've been able to remove some icons by disabling plugins like the Rainlab Blog and Builder, but Dashboard, CMS, and Media remain there. How can I remove them?

backend login top bar

From the official documentation on extending plugins I found this:

Event::listen('backend.menu.extendItems', function($manager) {

    $manager->removeMainMenuItem('October.Cms', 'cms');
    $manager->removeSideMenuItem('October.Cms', 'cms', 'pages');

});

But I haven't found which plugin I can add this listener code to, nor the names of the Dashboard and CMS items.

Does someone know? I'll post a solution if I can find one...

Upvotes: 0

Views: 911

Answers (2)

Panagiotis Koursaris
Panagiotis Koursaris

Reputation: 4023

You can create your own plugin and within the boot method try:

public function boot()
{
    Event::listen('backend.menu.extendItems', function($manager) {
        $manager->removeMainMenuItem('October.Cms', 'cms');
        $manager->removeMainMenuItem('October.Backend', 'media');

    });
}

The above code will remove cms and media from backend main menu. With this way the authenticated users can access the media and cms page directly by URL. If you want to block them you can do it by creating a group and disallow what you want.

Upvotes: 3

Instead of creating a plugin you can use ACL Group. Create one group that don't have the authorization to use "CMS" and "Media" and add an admin to it.

Upvotes: 2

Related Questions