Remove "File Tracking" and "Link Tracking" tabs from ModelAdmin

Silverstripe Version: 4.2

Question:

How do I get rid of the File Tracking and Link Tracking tabs from modeladmin?

I’ve tried

public function getCMSFields()
{
    $fields = parent::getCMSFields();
    $fields->removeByName('Root.FileTracking');
    return $fields;
}

Did you try $fields->removeByName(‘FileTracking’). I think you are using the syntax for removeFieldFromTab.

1 Like

As @Tim mentioned and after reading some of the related GitHub issues, for CWP 2.1.1 recipe we went with a custom DataObject extensions removing the fields.

2 Likes

You can remove them both at once with:

$fields->removeByName(['FileTracking', 'LinkTracking']);

1 Like

Is there a Silverstripe 4 Version where Link Tracking and File Tracking do not show up automagically for all DataObjects?

They seem to be gone in SS4.3 ModelAdmin

Thank you, that is great news.