Brad.EH
  1. SilverStripe\Admin\CMSMenu
  2. remove_menu_class:
  3. - SilverStripe\CampaignAdmin\CampaignAdmin
joris

I always do this by creating a class LeftAndMainExtension extends \SilverStripe\Admin\LeftAndMainExtension and inside its public function onAfterInit() I do CMSMenu::remove_menu_item('SilverStripe-CampaignAdmin-CampaignAdmin'); etc. Just make sure to set that as an Extension of SilverStripe\Admin\LeftAndMain in the config then.

(there might be other ways, but I don't know those)

joris

I see now that you can indeed just do SilverStripe\Admin\CMSMenu::remove_menu_class('SilverStripe\CampaignAdmin\CampaignAdmin');, but this is a function call in _config.php, not a setting in a yml file. I don't think it's available that way.

Brad.EH

Using yaml, how do you remove items from the left admin menu?

Brad.EH

Not sure if i'll get a quick response, but just curious if there's a way I can either point a search result to go to it's own results url instead of staying on the current page type. Or maybe a variable i can see in a template that tells me when i'm on the page with search results so i can hide stuff

Brad.EH
  1. $tab = new Tab('Root.Hero', 'Hero');
  2. $tab->push(TextField::create('HeroSubtitle','Subtitle'));