function hook_responsive_menu_off_canvas_tree_alter in Responsive and off-canvas menu 4.4.x
Same name and namespace in other branches
- 8.3 responsive_menu.api.php \hook_responsive_menu_off_canvas_tree_alter()
- 8.2 responsive_menu.api.php \hook_responsive_menu_off_canvas_tree_alter()
- 7.3 responsive_menu.api.php \hook_responsive_menu_off_canvas_tree_alter()
- 7.2 responsive_menu.api.php \hook_responsive_menu_off_canvas_tree_alter()
- 4.0.x responsive_menu.api.php \hook_responsive_menu_off_canvas_tree_alter()
- 4.1.x responsive_menu.api.php \hook_responsive_menu_off_canvas_tree_alter()
- 4.3.x responsive_menu.api.php \hook_responsive_menu_off_canvas_tree_alter()
Alter the off-canvas menu tree.
Parameters
array $rendered_tree: The built menu tree to be altered. This is provided as a render array.
1 function implements hook_responsive_menu_off_canvas_tree_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
1 invocation of hook_responsive_menu_off_canvas_tree_alter()
- OffCanvas::preRender in src/
OffCanvas.php - Pre render callback to assemble the menu as markup.
File
- ./
responsive_menu.api.php, line 42 - Responsive menu module APIs.
Code
function hook_responsive_menu_off_canvas_tree_alter(array &$rendered_tree) {
// Modify the off-canvas mobile menu tree and change the title of the
// first item.
$first = key($rendered_tree['#items']);
$rendered_tree['#items'][$first]['title'] = 'first';
}