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.

Customising the CMS /

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

Remove CMS tabs


Go to End


7 Posts   17696 Views

Avatar
DanStephenson

Community Member, 116 Posts

13 February 2009 at 5:52am

I know that I can remove a tab from inside the CMS using something like this:

$fields->removeFieldFromTab("Root.Content.Main","Content");

But how can I go about removing a whole tab?

Avatar
Carbon Crayon

Community Member, 598 Posts

14 February 2009 at 12:10am

Hi dan

try this inside your getCMSFields function:

$fields->removeByName("TabName");

that should do it :)

Avatar
Heike-san

Community Member, 52 Posts

20 October 2009 at 3:05am

Hi I am also try to remove the Help Tab to no avail I have tried what you suggested aram, but it still does not work!!
Also I have tried to add this line inside of my getCMSFields():

$fields->removeFieldFromTab("Root","Help");

and it is not working either, can anyone help ?

Avatar
Heike-san

Community Member, 52 Posts

20 October 2009 at 5:37am

I've worked it out.
If anyone is interested you can suppress the Help tab by commenting the CMSMenu::add_link('Help'.....) that is locateed inside of the LeftAndMain.php in the cms folder.

Avatar
socks

Community Member, 191 Posts

5 February 2010 at 4:37pm

Edited: 05/02/2010 4:39pm

If you want to remove one tab (Main) from Content:

$fields->removeFieldFromTab('Root.Content', 'Main');

If you need to remove multiple tabs (Main, OtherTab, ThirdTab) from Content:

 
$fields->removeFieldsFromTab('Root.Content',
 	array(
		'Main',
		'OtherTab',
		'ThirdTab'
	)
);

Avatar
bxxxxx

Community Member, 8 Posts

18 May 2011 at 3:41am

Better use this in your _config.php:

CMSMenu::remove_menu_item('Help');

Avatar
swaiba

Forum Moderator, 1899 Posts

18 May 2011 at 4:45am

Maybe, but that if possible you should create a user that has access to only certain tabs using the Security section instead of hacking the code.
Of course if you are talking about "Help" that has to be done as you describe or if the user needs admin access then again, yes to the code hack.