Jump to:

23450 Posts in 18899 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » [SOLVED] Add tab before 'Metadata' in the CMS

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: 979 Views
  • jizzman
    Community Member
    23 Posts

    [SOLVED] Add tab before 'Metadata' in the CMS Link to this post


    Probably another easy one. I'd like to add tabs so that the 'Metadata' is always the last in the tab set. For instance I have a two column page layout (left/right) and here I try to add the right column tab so it appears before the 'Metadata' tab in the CMS:

    $fields->addFieldToTab('Root.Content.RightColumn', new HtmlEditorField('Right_', 'Right Side'), 'Metadata');

    This doesn't seem to work. I still end up with tab order [Main|Metadata|Right Side]

    Is there something special about the 'Metadata' tab?


  • jizzman
    Community Member
    23 Posts

    Re: [SOLVED] Add tab before 'Metadata' in the CMS Link to this post

    I found the answer on Stack Overflow: http://stackoverflow.com/questions/5033028/silverstripe-how-do-i-insert-a-tab-before-another-tab

    For anyone else, the solution is to first create the tab manually so you can position it:

    $fields->insertBefore(new Tab('MyNewTab', 'My New Tab'), 'Metadata');

    and then just add your fields to the new tab:

    $fields->addFieldToTab('Root.Content.MyNewTab', new TextField(...));

    My problem was letting addFieldToTab() create the tab automatically; in that case you can't manually position it.

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.