Jump to:

23007 Posts in 11866 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » SilverStripe 3 ..Tabs!

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

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

Page: 1
Go to End
Author Topic: 655 Views
  • DesignerX.com.au
    Avatar
    Community Member
    107 Posts

    SilverStripe 3 ..Tabs! Link to this post

    Hi:
    How does the new tabs in the CMS work? Can we have sub-tabs anymore ?
    For example, If i have Gallerypage i will need the following tabs:
    Content->
    Gallery->Images
    Gallery->Settings
    Gallery->AdvancedSettings (With access limited to a member or group )
    Settings -> ... & so on

    Does sub-tabs work anymore ? if so, how do i get them working.
    Thanks

  • merrick_sd
    Avatar
    Community Member
    89 Posts

    Re: SilverStripe 3 ..Tabs! Link to this post

    I'd like some example also.

    I'd like to know how to do a "drop tab" just like the metadata has! that way it could save space.

    I have figured out how to add a tab

    eg Info panel
    extract

       $fields->addFieldToTab("Root.IntroPanel",
          
          new HTMLEditorField('IntroPanelOne',
          _t('Page.ColumnOne','Panel1')
          )
          );

    full

    <?php
    class Page extends SiteTree {

       public static $db = array(
       
          'topnav' => 'Boolean',//menu
          'IntroPanelOne' => 'HTMLText',
          'IntroPanelTwo' => 'HTMLText',
          'IntroPanelThree' => 'HTMLText'
       );

       public static $has_one = array(
       //'Page' => 'SiteTree'
       );
       
       
       static $defaults = array(
       'topnav' => 1
       );
       
       function getCMSFields() {
          $fields = parent::getCMSFields();
       
          //menu
       $fields->addFieldToTab("Root.Main",
             new CheckboxField(
             'topnav',
              _t('Page.topnav', 'Tick to show on top nav')
              ),
              'Content'
       );
          
          
          $fields->addFieldToTab("Root.IntroPanel",
          
          new HTMLEditorField('IntroPanelOne',
          _t('Page.ColumnOne','Panel1')
          )
          );
          
          
          $fields->addFieldToTab("Root.IntroPanel",
          
          new HTMLEditorField('IntroPanelTwo',
          _t('Page.ColumnOne','Panel2')
          )
          );
          
          
          $fields->addFieldToTab("Root.IntroPanel",
          
          new HTMLEditorField('IntroPanelThree',
          _t('Page.ColumnOne','Panel3')
          )
          );
          
                
          //Main
       
          
             return $fields;
          } //endgetCMSFields

  • pbenoit
    Avatar
    Community Member
    9 Posts

    Re: SilverStripe 3 ..Tabs! Link to this post

    The way to achieve the drop down like Matatags is like this.

    $fields->addFieldToTab("Root.Main", new ToggleCompositeField('UniqueName', 'Section Name',
          array(
             new TextField('HeroTitle', 'Title'),
          )
       ), 'Metadata');

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