function PreprocessHooks::preprocessNavigation
Same name and namespace in other branches
- main core/themes/default_admin/src/Hook/PreprocessHooks.php \Drupal\default_admin\Hook\PreprocessHooks::preprocessNavigation()
Implements hook_preprocess_HOOK() for navigation.
Attributes
#[Hook('preprocess_navigation')]
File
-
core/
themes/ default_admin/ src/ Hook/ PreprocessHooks.php, line 962
Class
- PreprocessHooks
- Provides preprocess implementations.
Namespace
Drupal\default_admin\HookCode
public function preprocessNavigation(array &$variables) : void {
// Get theme configs.
$logo_default = Settings::getInstance()->getDefault('logo.use_default');
$variables['icon_path'] = !$logo_default ? Settings::getInstance()->getDefault('logo.path') : '';
$variables['navigation'] = $this->moduleHandler
->moduleExists('navigation');
$variables['is_backend'] = TRUE;
// Attach the new drupal navigation styles.
$variables['#attached']['library'][] = 'default_admin/navigation';
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.