Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Remove Menu Item from Admin


Go to End


22 Posts   16855 Views

Avatar
MarijnKampf

Community Member, 176 Posts

3 April 2010 at 7:59pm

Edited: 03/04/2010 8:00pm

CMSMenu::remove_menu_item('AssetAdmin');

You can often discover this type of information easily by looking at the id attribute in the html source. In this case the 'Files & Images' source shows:

<li class="" id="Menu-AssetAdmin"><a href="admin/assets/">Files &amp; Images</a></li>

I tried AssetAdmin and it worked.

Avatar
itobe

Community Member, 4 Posts

24 July 2010 at 4:35am

btw....

for the "Reports" tab:
CMSMenu::remove_menu_item('ReportAdmin');

Avatar
klikhier

Community Member, 150 Posts

17 October 2010 at 2:19am

I just tried this in _config.php:

//Hide a main CMS Tab
CMSMenu::remove_menu_item('CommentAdmin');
CMSMenu::remove_menu_item('ReportAdmin');
CMSMenu::remove_menu_item('Help');

The first two work, but 'Help' is still visible (in SS 2.4.2)...

Avatar
MarijnKampf

Community Member, 176 Posts

17 October 2010 at 5:19am

See http://www.silverstripe.org/general-questions/show/260655?start=0#post263444 on how to remove the help tab from the admin.

Avatar
MrFail

Community Member, 5 Posts

24 June 2015 at 2:06am

Fatal error: Class 'LeftAndMainDecorator' not found in /var/www/redsoft.com/www/mysite/code/MyLeftAndMainDecorator.php on line 3

Avatar
Pyromanik

Community Member, 419 Posts

25 June 2015 at 8:17am

This thread is six years old, and is about the 2.x series (no longer supported).
That last post is 5 years old and has the same result.

Although the example you seem to be looking at is well out of date, it looks like the original answer will still work.

Add the following to mysite/_config.php

CMSMenu::remove_menu_item('Help');

Go to Top