Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Remove behaviour and access tabs

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 2198 Views
  • danbalbo
    Avatar
    Community Member
    6 Posts

    Remove behaviour and access tabs Link to this post

    I am trying to remove the behaviour and access tabs but without any results. This is my code in page.php class.

    function getCMSFields() {
    $fields = parent::getCMSFields();
    $fields->removeByName("Behaviour");
    $fields->removeByName("Behaviour"); // doesnt work -> behaviour tab is still there
    $fields->removeByName("To-do"); // it works-> to do tab is removed
    }

  • danbalbo
    Avatar
    Community Member
    6 Posts

    Re: Remove behaviour and access tabs Link to this post

    Nobody can help me?

  • JGC
    Avatar
    Community Member
    25 Posts

    Re: Remove behaviour and access tabs Link to this post

    I've used this in mysite/_config.php for a recent site I've done, where I wanted to make the CMS very simple by putting pages along the top, and not having a sidebar, with only a few tabs on each page.

    CMSMenu::remove_menu_item('Identifier');

    Where Identifier is the name of the class which calls that part of the CMS - look in /cms/code for them.

    CMSMain is Site Content, and the odd one out. The others should be fairly easy - CommentAdmin is Comments, ReportAdmin, NewsletterAdmin, AssetAdmin, etc.

    You can also add your own to the menu with

    CMSMenu::add_link($code, $menuTitle, $url, $priority = -1)


    Where $code is an arbitrary name, no spaces ('AboutPage', 'Blue', 'Yes_no'), $menuTitle appears as the link text, $url is the link itself, and $priority moves it between left and right. Higher priority is left, lower priority is right.

    2198 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.