function hook_navigation_content_top_alter

Alter replacement values for placeholder tokens.

Parameters

$content_top: An associative array of content returned by hook_navigation_content_top().

See also

hook_navigation_content_top()

Related topics

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.