Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Remove CMS tabs

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

Page: 1
Go to End
Author Topic: 6964 Views
  • DanStephenson
    Avatar
    Community Member
    115 Posts

    Remove CMS tabs Link to this post

    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?

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Remove CMS tabs Link to this post

    Hi dan

    try this inside your getCMSFields function:

    $fields->removeByName("TabName");

    that should do it

  • Heike-san
    Avatar
    Community Member
    52 Posts

    Re: Remove CMS tabs Link to this post

    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 ?

  • Heike-san
    Avatar
    Community Member
    52 Posts

    Re: Remove CMS tabs Link to this post

    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.

  • socks
    Avatar
    Community Member
    190 Posts

    Re: Remove CMS tabs Link to this post

    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'
       )
    );

  • bxxxxx
    Avatar
    Community Member
    8 Posts

    Re: Remove CMS tabs Link to this post

    Better use this in your _config.php:

    CMSMenu::remove_menu_item('Help');

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Remove CMS tabs Link to this post

    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.

    6964 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.