mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
22 lines
417 B
PHP
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'));
|
||
|
}
|
||
|
}
|