I have created several custom tabs. Now I want to move the "Metadata" tab to end.
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
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");
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.
This worked for me:
$metadataTab = $fields->findOrMakeTab('Root.Content.Metadata');
$fields->removeByName('Metadata');
$fields->addFieldToTab('Root.Content', $metadataTab);