function hook_navigation_content_top_alter
Alter replacement values for placeholder tokens.
Parameters
array $content_top: An associative array of content returned by hook_navigation_content_top().
See also
Related topics
1 function implements hook_navigation_content_top_alter()
Note: the procedural functions in this list are found by pattern matching, so the list may include some functions that are not actually implementations of this hook.
- NavigationTestHooks::navigationContentTopAlter in core/
modules/ navigation/ tests/ navigation_test/ src/ Hook/ NavigationTestHooks.php - Implements hook_navigation_content_top_alter().
1 invocation of hook_navigation_content_top_alter()
- NavigationRenderer::getContentTop in core/
modules/ navigation/ src/ NavigationRenderer.php - Gets the content for content_top section.
File
-
core/
modules/ navigation/ navigation.api.php, line 46
Code
function hook_navigation_content_top_alter(array &$content_top) : void {
// Remove a specific element.
unset($content_top['navigation_foo']);
// Modify an element.
$content_top['navigation_bar']['#markup'] = 'new bar';
// Change weight.
$content_top['navigation_baz']['#weight'] = '-100';
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.