$fields = new FieldList( // create fields here ); $fields->removeFieldFromTab('MyTab', 'MyField'); // remove 'MyField' from 'MyTab'
$fields = $this->getCMSFields(); $fields->removeFieldFromTab('Root.Main', 'Title'); // remove the 'Title' field from the 'Main' tabIn these examples, the FieldList object is first created and populated with fields. Then, the removeFieldFromTab method is used to remove a specific field from a specific tab. The first argument is the tab name, and the second argument is the field name. Overall, FieldList removeFieldFromTab is a useful method for customizing form layouts in the SilverStripe CMS package/library.