I would like to re-order the items on the left-hand side of the CMS (the one with Pages, Files, Security). What is the easiest way to do this? Also, I want to hide “Campaigns”.
Lastly, has anyone looked at the Group CMS Menu Items for four?
In terms of hiding menu items, the simplest way to do so is with the permissions system of the CMS. People in the ‘Administrators’ group have access to everything, but you can set up a different group for general admin use and uncheck the ‘access to campaigns’ permission on that group.
To remove a menu item you can use SilverStripe\Admin\CMSMenu::remove_menu_class('CampaignAdmin');
in your _config.php file.
To remove the whole campaigns module you should be able to just not include it in your composer.json, or if you include a recipe in your composer file, you can use
“replace”: {
“silverstripe/campaign-admin”: “*”
},
to tell composer you handle this dependency yourself and to not install it.
use SilverStripe\Reports\ReportAdmin;
use SilverStripe\Admin\SecurityAdmin;
use SilverStripe\VersionedAdmin\ArchiveAdmin;
use SilverStripe\CampaignAdmin\CampaignAdmin;
CMSMenu::remove_menu_class(ReportAdmin::class);
CMSMenu::remove_menu_class(SecurityAdmin::class);
CMSMenu::remove_menu_class(ArchiveAdmin::class);
CMSMenu::remove_menu_class(CampaignAdmin::class);