function NavigationHooks::help
Implements hook_help().
File
-
core/
modules/ navigation/ src/ Hook/ NavigationHooks.php, line 22
Class
- NavigationHooks
- Hook implementations for navigation.
Namespace
Drupal\navigation\HookCode
public function help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.navigation':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Navigation module provides a left-aligned, collapsible, vertical sidebar navigation.') . '</p>';
$output .= '<p>' . t('For more information, see the <a href=":docs">online documentation for the Navigation module</a>.', [
':docs' => 'https://www.drupal.org/project/navigation',
]) . '</p>';
return $output;
}
$configuration_route = 'layout_builder.navigation.';
if (!$route_match->getRouteObject()
->getOption('_layout_builder') || !str_starts_with($route_name, $configuration_route)) {
return \Drupal::moduleHandler()->invoke('layout_builder', 'help', [
$route_name,
$route_match,
]);
}
if (str_starts_with($route_name, $configuration_route)) {
$output = '<p>' . t('This layout builder tool allows you to configure the blocks in the navigation toolbar.') . '</p>';
$output .= '<p>' . t('Forms and links inside the content of the layout builder tool have been disabled.') . '</p>';
return $output;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.