Merge pull request #228 from assertchris/reorder-fields

Reordered fields
This commit is contained in:
Damian Mooyman 2015-05-14 12:27:36 +12:00
commit 17832fd942

View File

@ -165,6 +165,14 @@ class BlogPost extends Page {
$self =& $this; $self =& $this;
$this->beforeUpdateCMSFields(function ($fields) use ($self) { $this->beforeUpdateCMSFields(function ($fields) use ($self) {
$uploadField = UploadField::create('FeaturedImage', _t('BlogPost.FeaturedImage', 'Featured Image'));
$uploadField->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif'));
/**
* @var FieldList $fields
*/
$fields->insertAfter($uploadField,'Content');
$summary = HtmlEditorField::create('Summary', false); $summary = HtmlEditorField::create('Summary', false);
$summary->setRows(5); $summary->setRows(5);
$summary->setDescription(_t( $summary->setDescription(_t(
@ -182,18 +190,7 @@ class BlogPost extends Page {
$summaryHolder->setHeadingLevel(4); $summaryHolder->setHeadingLevel(4);
$summaryHolder->addExtraClass('custom-summary'); $summaryHolder->addExtraClass('custom-summary');
/** $fields->insertAfter($summaryHolder, 'FeaturedImage');
* @var FieldList $fields
*/
$fields->insertBefore($summaryHolder, 'Content');
$uploadField = UploadField::create('FeaturedImage', _t('BlogPost.FeaturedImage', 'Featured Image'));
$uploadField->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif'));
$fields->insertAfter(
$uploadField,
'Content'
);
$fields->push(HiddenField::create('MenuTitle')); $fields->push(HiddenField::create('MenuTitle'));