Yeah, I tried both of those but neither worked. To clarify, this is what I have:
Page.php
…
// SIDEBAR IMAGES
$manager = new ImageDataObjectManager(
$this, // Controller
'SidebarImages', // Source name
'SidebarImage', // Source class
'Attachment', // File name on DataObject
array(// Headings
),
'getCMSFields_forPopup' // Detail fields (function name or FieldSet object)
// Filter clause
// Sort clause
// Join clause
);
$manager->setAddTitle('Image');
$manager->allowUploadFolderSelection();
$fields->addFieldToTab('Root.Content.SidebarImages', $manager);
…
Trying to remove the tab Sidebar Images from above in DataObjectDecorator below:
CustomBlaBlaPage.php
<?php
class CustomBlaBlaPage extends DataObjectDecorator {
public function getCMSFields() {
$fields = parent::getCMSFields();
$this->extend('updateCMSFields', $fields);
return $fields;
}
public function updateCMSFields(FieldSet $fields) {
$fields->removeFieldFromTab('Root.Content','Metadata'); // THIS WORKS
$fields->removeFieldFromTab('Root.Content','GoogleSitemap'); // THIS WORKS
$fields->removeFieldFromTab('Root.Content','SidebarImages'); // THIS DOESN'T WORK
}
}
Maybe I'm not going about it the right way.