public function getCMSFields()
    {
        $this->beforeUpdateCMSFields(function ($fields) {
            /** @var FieldList $fields */
            $fields->removeByName(array(
                'Sort',
            ));

            // Add a combined field for "Title" and "Displayed" checkbox in a Bootstrap input group
            $fields->removeByName('ShowTitle');
            $fields->replaceField(
                'Title',
                TextCheckboxGroupField::create()
                    ->setName($this->fieldLabel('Title'))
            );

            $fields->replaceField(
                'ElementLinkID',
                LinkField::create('ElementLinkID', $this->fieldLabel('ElementLinkID'))
                    ->setDescription(_t(__CLASS__.'.LinkDescription', 'optional. Add a call to action link.'))
            );
            $fields->insertBefore($fields->dataFieldByName('ElementLinkID'), 'Content');

            $image = $fields->dataFieldByName('Image')
                ->setDescription(_t(__CLASS__.'.ImageDescription', 'optional. Display an image.'))
                ->setFolderName('Uploads/Elements/Objects');
            $fields->insertBefore($image, 'Content');

            $fields->dataFieldByName('Content')
                ->setRows(8);
        });

        return parent::getCMSFields();
    }
public function getCMSFields()
    {
        $this->beforeUpdateCMSFields(function ($fields) {
            /** @var FieldList $fields */
            $fields->removeByName(array(
                'Sort',
            ));

            // Add a combined field for "Title" and "Displayed" checkbox in a Bootstrap input group
            $fields->removeByName('ShowTitle');
            $fields->replaceField(
                'Title',
                TextCheckboxGroupField::create()
                    ->setName($this->fieldLabel('Title'))
            );

            $fields->replaceField(
                'ElementLinkID',
                LinkField::create('ElementLinkID', $this->fieldLabel('ElementLinkID'))
                    ->setDescription(_t(__CLASS__.'.LinkDescription', 'optional. Add a call to action link.'))
            );
            $fields->insertBefore($fields->dataFieldByName('ElementLinkID'), 'Content');

            $image = $fields->dataFieldByName('Image')
                ->setDescription(_t(__CLASS__.'.ImageDescription', 'optional. Display an image.'))
                ->setFolderName('Uploads/Elements/Objects');
            $fields->insertBefore($image, 'Content');

            $fields->dataFieldByName('Content')
                ->setRows(8);
        });

        return parent::getCMSFields();
    }
@return FieldList

@throws \Exception