You are here

function hook_cheeseburger_menu_alter in Cheeseburger Menu 5.0.x

Implements hook_cheeseburger_menu_alter().

1 invocation of hook_cheeseburger_menu_alter()
CheeseburgerMenuBlock::createHooks in src/Plugin/Block/CheeseburgerMenuBlock.php
Invokes all hooks provided by cheeseburger_menu module.

File

./cheeseburger_menu.api.php, line 29
Hooks provided by the Cheeseburger menu module.

Code

function hook_cheeseburger_menu_alter(\Drupal\cheeseburger_menu\CheeseburgerMenu $cheeseburger_menu) {
  if ($cheeseburger_menu
    ->getOriginalEntityTypeId() === 'menu' && $cheeseburger_menu
    ->getOriginalEntityId() === 'main') {
    $cheeseburger_menu
      ->setTitle('Cheeseburger title for menu');
    $cheeseburger_menu->navigationItemAttribute
      ->addClass('special-menu-navigation-class');
    $cheeseburger_menu->titleAttribute
      ->addClass('special-menu-title-class');
  }
  if ($cheeseburger_menu
    ->getOriginalEntityTypeId() === 'taxonomy_vocabulary' && $cheeseburger_menu
    ->getOriginalEntityId() === 'category') {
    $cheeseburger_menu
      ->setTitle('Cheeseburger taxonomy menu example');
  }
}