menu_ui_block_view_system_menu_block_alter

menu_ui_block_view_system_menu_block_alter(array &$build, BlockPluginInterface $block)

Implements hook_block_view_BASE_BLOCK_ID_alter() for 'system_menu_block'.

File

core/modules/menu_ui/menu_ui.module, line 120
Allows administrators to customize the site's navigation menus.

Code

function menu_ui_block_view_system_menu_block_alter(array &$build, BlockPluginInterface $block) {
  if ($block->getBaseId() == 'system_menu_block') {
    $menu_name = $block->getDerivativeId();
    $build['#contextual_links']['menu'] = array(
      'route_parameters' => array('menu' => $menu_name),
    );
  }
}
doc_Drupal
2016-10-29 09:27:50
Comments
Leave a Comment

Please login to continue.