public function updateCMSFields(FieldList $fields) { $gridConfig = singleton('Block')->has_extension('Sortable') ? GridFieldConfig_BlockEditor::create('SortOrder') : GridFieldConfig_BlockEditor::create(); $gridField = GridField::create('Blocks', _t('PageBlocks.BLOCK', 'Block', 'GridField Title'), $this->owner->Blocks(), $gridConfig); $gridField->setModelClass('Block'); $fields->addFieldsToTab('Root.Main', array($gridField), 'Metadata'); }
public function updateCMSFields(FieldList $fields) { $gridConfig = GridFieldConfig_BlockEditor::create('SortOrder', $this->owner->config()->get('allowed_blocks')); $gridField = GridField::create('Blocks', _t('PageBlocks.BLOCK', 'Block', 'GridField Title'), $this->owner->Blocks(), $gridConfig); $gridField->setModelClass('Block'); $fields->addFieldsToTab('Root.Main', array($gridField), 'Metadata'); }