Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Add Third Level Tabs

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

Page: 1
Go to End
Author Topic: 2112 Views
  • DeklinKelly
    Avatar
    Community Member
    196 Posts

    Add Third Level Tabs Link to this post

    How can I create a third level of tabs in the administrative area of the CMS?

    I can create a new tab named "Zooph" like this:

    $fields->addFieldToTab("Root.Content.Zooph", new LiteralField('CustomCode1','Hello World'));

    But how can I create a deeper level of tabs under "Zooph"?

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Add Third Level Tabs Link to this post

    AFAIK you can only create 2 levels. If Root.Content.Zooph.Test doesn't work then I would assume it doesn't work.

  • Martijn
    Avatar
    Community Member
    271 Posts

    Re: Add Third Level Tabs Link to this post

    You can add new TabSets easily:

    function getCMSFields() {
          $fields = parent::getCMSFields();
          
          $fields->addFieldToTab("Root.Content.ContentBlocks",new TabSet('ContentBlockSet',
             new Tab('HeaderContent', new HTMLEditorField("HeaderContent")),
             new Tab('LeftContent', new HTMLEditorField("LeftContent")),
             new Tab('RightContent', new HTMLEditorField("RightContent"))
          ));
          
          $fields->addFieldToTab("Root.Content.Widgets",new TabSet('WidgetsSet',
             new Tab('WidgetsLeftTop', new WidgetAreaEditor("WidgetsLeftTopArea")),
             new Tab('WidgetsLeftBottom', new WidgetAreaEditor("WidgetsLeftBottomArea")),
             new Tab('WidgetsRightTop', new WidgetAreaEditor("WidgetsRightTopArea")),
             new Tab('WidgetsRightBottom', new WidgetAreaEditor("WidgetsRightBottomArea"))
          ));

          return $fields;
       }

    http://doc.silverstripe.org/tabset

  • Graphicator
    Avatar
    Community Member
    62 Posts

    Re: Add Third Level Tabs Link to this post

    Thank you for this fresh information.

    I ran into a website error whenever I added more than four 2nd-level tabs in the CMS. This solution was a breeze.

    Attached Files
    2112 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.