SilverStripe: how to insert a tab before another tab?

I am trying to insert a new admin tab before Root.Content.Main with no luck. I tried:

$fields->insertBefore(new Tab('Root.Content.Overview', 'Overview'), 'Root.Content.Main'); 

and

 $fields->addFieldToTab('Root.Content', new Tab('OverviewTab', 'Root.Content.Overview'), 'Root.Content.Main'); 

no luck.

Does anyone have any ideas? I hunted for the API, but not much explanation of how the tab naming system works.

+4
source share
1 answer

Figured it out ...

 $fields->insertBefore(new Tab('Overview', 'Project Overview'), 'Main'); 
+13
source

Source: https://habr.com/ru/post/1340214/


All Articles