-
-
Save daslicht/2ad51a56a7fc1d5cda7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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