From 1085c8cbd598162df0e0e3a376efbdd3c1d9c32c Mon Sep 17 00:00:00 2001 From: David Rapson Date: Tue, 13 Nov 2018 13:55:27 +0000 Subject: [PATCH] Custom module to support element type sort --- composer.json | 2 +- config/app.php | 10 ++++++++++ modules/control-panel/Module.php | 24 ++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 config/app.php create mode 100644 modules/control-panel/Module.php diff --git a/composer.json b/composer.json index fefaad34..012c626a 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ }, "autoload" : { "psr-4" : { - "biglotteryfund\\" : "lib/" + "biglotteryfund\\" : [ "modules/", "lib/" ] } }, "config": { diff --git a/config/app.php b/config/app.php new file mode 100644 index 00000000..d7feefad --- /dev/null +++ b/config/app.php @@ -0,0 +1,10 @@ + [ + 'control-panel' => biglotteryfund\Module::class, + ], + 'bootstrap' => [ + 'control-panel', + ], +]; \ No newline at end of file diff --git a/modules/control-panel/Module.php b/modules/control-panel/Module.php new file mode 100644 index 00000000..d34e6d8e --- /dev/null +++ b/modules/control-panel/Module.php @@ -0,0 +1,24 @@ +sortOptions[] = [ + 'orderBy' => 'typeId', + 'label' => \Craft::t('app', 'Entry Type'), + 'attribute' => 'type', + ]; + }); + } +}