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.

General Questions /

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

Move "Metadata" tab to end


Reply


4 Posts   1693 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);