Ejemplo n.º 1
0
 /**
  * Get CMS Fields
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('Images');
     $fields->removeFieldsFromTab('Root.Main', array('BackgroundImage'));
     $gridFieldBulkUpload = new GridFieldBulkUpload();
     $gridFieldBulkUpload->setUfSetup('setFolderName', 'GalleryImages/' . $this->ID);
     $fields->insertBefore(GridField::create('Images', 'Images', $this->Images(), GridFieldConfig_RecordEditor::create()->addComponent(new GridFieldSortableRows('SortOrder'))->addComponent($gridFieldBulkUpload)), 'ExtraClassDescriptionContainer');
     return $fields;
 }
Ejemplo n.º 2
0
 /**
  * Get CMS Fields
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->dataFieldByName('Content')->setRows(20);
     $fields->replaceField('VideoURL', TextField::create('VideoURL', 'Video URL'));
     $fields->replaceField('RedirectPageID', TreedropdownField::create('RedirectPageID', 'Choose a redirect page', 'SiteTree'));
     $fields->dataFieldByName('Image')->setTitle('Placeholder')->setFolderName('BlockWidgetVideo/' . $this->ID . '/Images');
     $fields->insertAfter($fields->dataFieldByName('Tagline'), 'Title');
     $fields->insertAfter($fields->dataFieldByName('Content'), 'Tagline');
     $fields->insertAfter($fields->dataFieldByName('VideoURL'), 'Content');
     $fields->insertAfter($fields->dataFieldByName('ButtonText'), 'VideoURL');
     $fields->insertAfter($fields->dataFieldByName('RedirectPageID'), 'ButtonText');
     $fields->insertAfter($fields->dataFieldByName('Image'), 'RedirectPageID');
     $fields->insertAfter($fields->dataFieldByName('BackgroundImage')->setFolderName('BlockWidgetVideo/' . $this->ID . '/BackgroundImages/'), 'Image');
     return $fields;
 }