Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

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.

General Questions /

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

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

Move "Metadata" tab to end


Go to End


4 Posts   3030 Views

Avatar
DeklinKelly

Community Member, 197 Posts

6 May 2009 at 6:38am

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

Avatar
Howard

Community Member, 215 Posts

6 May 2009 at 1:08pm

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");

Avatar
DeklinKelly

Community Member, 197 Posts

6 May 2009 at 11:28pm

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.

Avatar
chadws

Community Member, 9 Posts

18 June 2009 at 2:25am

This worked for me:

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