diff --git a/.idea/Silverstripe-Block-Page.iml b/.idea/Silverstripe-Block-Page.iml
new file mode 100644
index 0000000..197f7d4
--- /dev/null
+++ b/.idea/Silverstripe-Block-Page.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..28a804d
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..c3c866c
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..7dc344b
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,201 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $PROJECT_DIR$/composer.json
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1575300604857
+
+
+ 1575300604857
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Admin/BlockAdmin.php b/src/Admin/BlockAdmin.php
index fecf0a6..766b3e7 100644
--- a/src/Admin/BlockAdmin.php
+++ b/src/Admin/BlockAdmin.php
@@ -22,4 +22,16 @@ public function getEditForm($id = null, $fields = null)
return $form;
}
+
+ public function getList()
+ {
+ $list = parent::getList();
+ $requestFilters = $this->getRequest()->requestVar('filter');
+ $filters = [];
+ if (isset($requestFilters['CyberDuck-BlockPage-Model-ContentBlock']['ClassName']) and ! empty($requestFilters['CyberDuck-BlockPage-Model-ContentBlock']['ClassName'])) {
+ $filters['ClassName'] = $requestFilters['CyberDuck-BlockPage-Model-ContentBlock']['ClassName'];
+ }
+
+ return $list->filter($filters);
+ }
}
\ No newline at end of file
diff --git a/src/Model/ContentBlock.php b/src/Model/ContentBlock.php
index b3ff56c..a062a12 100644
--- a/src/Model/ContentBlock.php
+++ b/src/Model/ContentBlock.php
@@ -5,6 +5,7 @@
use Page;
use SilverStripe\Control\Controller;
use SilverStripe\Core\Config\Config;
+use SilverStripe\Forms\DropdownField;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\GridField\GridField;
use SilverStripe\Forms\GridField\GridFieldAddNewButton;
@@ -48,12 +49,23 @@ class ContentBlock extends DataObject implements PermissionProvider
private static $summary_fields = [
'Thumbnail' => '',
- 'ID' => 'ID',
- 'BlockType' => 'Content type',
+ 'ID' => 'ID',
+ 'ClassName' => 'Content type',
'Title' => 'Title',
'Pages.Count' => 'Pages'
];
+ public function searchableFields()
+ {
+ return [
+ 'BlockType' => [
+ 'filter' => 'ExactMatchFilter',
+ 'title' => 'Content Type',
+ 'field' => DropdownField::create('ClassName')->setSource(ContentBlock::get()->map('ClassName', 'ClassName'))->setEmptyString('-- Content Type --')
+ ]
+ ];
+ }
+
public function getThumbnail()
{
return DBField::create_field('HTMLText', sprintf('', $this->config()->get('preview')));