Ejemplo n.º 1
0
 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');
 }
Ejemplo n.º 2
0
 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');
 }