function hook_responsive_menu_off_canvas_tree_alter in Responsive and off-canvas menu 4.1.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.4.x 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.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 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']);
$render_array['#items'][$first]['title'] = 'first';
}