Skip to content

Instantly share code, notes, and snippets.

@arfaram
Last active June 14, 2019 13:31
Show Gist options
  • Save arfaram/588fd429ae87c378a6f13578dce19685 to your computer and use it in GitHub Desktop.
Save arfaram/588fd429ae87c378a6f13578dce19685 to your computer and use it in GitHub Desktop.
Example on how to remove the Content Browse Button from the Left Siedbar in eZPlatform 2. Note: you can dump $root and remove/add or reorder items ;)
<?php
declare(strict_types=1);
namespace AppBundle\Event\Listener;
use EzSystems\EzPlatformAdminUi\Menu\Event\ConfigureMenuEvent;
class ConfigureLeftSidebarMenuListener
{
public function onMenuConfigure(ConfigureMenuEvent $event): void
{
$root = $event->getMenu();
$root->removeChild('sidebar_left__browse');
}
}
services:
AppBundle\Event\Listener\ConfigureLeftSidebarMenuListener:
tags:
- { name: kernel.event_listener, event: ezplatform_admin_ui.menu_configure.content_sidebar_left, method: onMenuConfigure, priority: 10 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment