silverstripe-blog/code/extensions/BlogPostFeatureExtension.php
2015-11-13 15:06:29 +13:00

22 lines
417 B
PHP

<?php
class BlogPostFeatureExtension extends DataExtension {
/**
* @var array
*/
private static $db = array(
'IsFeatured' => 'Boolean',
);
/**
* @inheritdoc
*
* @param FieldList
*/
public function updateCMSFields(FieldList $fields) {
$sidebar = $fields->fieldByName('blog-admin-sidebar');
$sidebar->insertBefore('PublishDate', new CheckboxField('IsFeatured', 'Mark as featured post'));
}
}