Skip to content

Instantly share code, notes, and snippets.

@daslicht
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daslicht/2ad51a56a7fc1d5cda7e to your computer and use it in GitHub Desktop.
Save daslicht/2ad51a56a7fc1d5cda7e to your computer and use it in GitHub Desktop.
public function getCMSFields() {
$fields = parent::getCMSFields();
$conf = GridFieldConfig_RecordEditor::create(10);
$conf->addComponent(new GridFieldGalleryTheme('Image'));
$conf->addComponent(new GridFieldBulkUpload());
$conf->getComponentByType('GridFieldBulkUpload')->setConfig('folderName', $this->getRootFolderName());
$fields->addFieldToTab("Root.Gallery", Gridfield::create('Gallery', 'Gallery', $this->Images(), $conf));
$config = GridFieldConfig_RelationEditor::create();
$config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array(
'Name' => 'Name',
'Producer.Title'=> 'Producer' //??? where does title come from ?, i found it at tutorial 5
));
$producersField = new GridField(
'Producers',
'Producer',
$this->Producer(),
$config
);
$fields->addFieldToTab('Root.Producers', $producersField);
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment