Jump to:

22998 Posts in 11620 Topics by 2827 members

General Questions

SilverStripe Forums » General Questions » Move "Metadata" tab to end

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: 1547 Views
  • DeklinKelly
    Avatar
    Community Member
    196 Posts

    Move "Metadata" tab to end Link to this post

    I have created several custom tabs. Now I want to move the "Metadata" tab to end.

  • Howard
    Avatar
    Community Member
    215 Posts

    Re: Move "Metadata" tab to end Link to this post

    I am pretty sure this can be done by removing it then adding it in again at the end, ie:

     $f->removeFieldFromTab("Root.Content","Metadata");
    $f->addFieldToTab("Root.Content","Metadata");

  • DeklinKelly
    Avatar
    Community Member
    196 Posts

    Re: Move "Metadata" tab to end Link to this post

    Howard, your idea does not work.

    The first line successfully removes the Metadata tab, but when I add the second tab I get an error:

    Fatal error: Call to a member function Name() on a non-object in FieldSet.php on line 393

    It seems that it cannot be added again because it was removed.

  • chadws
    Avatar
    Community Member
    9 Posts

    Re: Move "Metadata" tab to end Link to this post

    This worked for me:

    $metadataTab = $fields->findOrMakeTab('Root.Content.Metadata');
    $fields->removeByName('Metadata');
    $fields->addFieldToTab('Root.Content', $metadataTab);

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