mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Merge commit '9feee011cf35edacba8198eec0e267d3552c1bab' into develop
Conflicts: composer.json
This commit is contained in:
commit
ab3b72e27b
@ -12,8 +12,8 @@ class GridFieldConfig_BlogPost extends GridFieldConfig_Lumberjack {
|
||||
|
||||
public function __construct($itemsPerPage = null) {
|
||||
parent::__construct($itemsPerPage);
|
||||
$this->removeComponentsByType('SiteTreeEditButton');
|
||||
$this->addComponent(new GridFieldSiteTreeEditButton());
|
||||
$this->removeComponentsByType('GridFieldSiteTreeState');
|
||||
$this->addComponent(new GridFieldBlogPostState());
|
||||
}
|
||||
|
||||
}
|
@ -69,11 +69,6 @@ class Blog extends Page {
|
||||
});
|
||||
|
||||
$fields = parent::getCMSFields();
|
||||
|
||||
// Ensure we're using the BlogPost GridField config and not Lumberjack's
|
||||
$gridField = $fields->dataFieldByName('ChildPages');
|
||||
$gridField->setConfig(GridFieldConfig_BlogPost::create());
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
@ -131,6 +126,7 @@ class Blog extends Page {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This sets the title for our gridfield
|
||||
*
|
||||
@ -140,6 +136,17 @@ class Blog extends Page {
|
||||
return _t('Blog.LumberjackTitle', 'Blog Posts');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This overwrites lumberjacks default gridfield config.
|
||||
*
|
||||
* @return GridFieldConfig
|
||||
*/
|
||||
public function getLumberjackGridFieldConfig() {
|
||||
return GridFieldConfig_Blog::create();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
"type": "silverstripe-module",
|
||||
"require": {
|
||||
"silverstripe/cms": "^3.1.0",
|
||||
"silverstripe/lumberjack": "^1.0.0"
|
||||
"silverstripe/lumberjack": "~1.1"
|
||||
},
|
||||
"license": "BSD-2-Clause",
|
||||
"authors": [
|
||||
|
Loading…
Reference in New Issue
Block a user