You are here

function hook_responsive_menu_horizontal_tree_alter in Responsive and off-canvas menu 8.2

Same name and namespace in other branches
  1. 8.3 responsive_menu.api.php \hook_responsive_menu_horizontal_tree_alter()
  2. 7.3 responsive_menu.api.php \hook_responsive_menu_horizontal_tree_alter()
  3. 7.2 responsive_menu.api.php \hook_responsive_menu_horizontal_tree_alter()
  4. 4.4.x responsive_menu.api.php \hook_responsive_menu_horizontal_tree_alter()
  5. 4.0.x responsive_menu.api.php \hook_responsive_menu_horizontal_tree_alter()
  6. 4.1.x responsive_menu.api.php \hook_responsive_menu_horizontal_tree_alter()
  7. 4.3.x responsive_menu.api.php \hook_responsive_menu_horizontal_tree_alter()

Alter the horizontal menu tree.

Parameters

array $rendered_tree: The built menu tree to be altered. This is provided as a render array.

1 invocation of hook_responsive_menu_horizontal_tree_alter()
HorizontalMenu::build in src/Plugin/Block/HorizontalMenu.php
Builds and returns the renderable array for this block plugin.

File

./responsive_menu.api.php, line 55
Responsive menu module APIs.

Code

function hook_responsive_menu_horizontal_tree_alter(array &$rendered_tree) {

  // Modify the horizontal menu tree and change the title of the first item.
  $first = key($rendered_tree['#items']);
  $render_array['#items'][$first]['title'] = 'first';
}