function NavigationTestThemeHooks::preprocessBlockNavigation
Implements hook_preprocess_HOOK().
Attributes
#[Hook('preprocess_block__navigation')]
File
-
core/
modules/ navigation/ tests/ navigation_test/ src/ Hook/ NavigationTestThemeHooks.php, line 18
Class
- NavigationTestThemeHooks
- Theme hook implementations for navigation_test module.
Namespace
Drupal\navigation_test\HookCode
public function preprocessBlockNavigation(&$variables) : void {
// Add some additional classes so we can target the correct contextual link
// in tests.
$variables['attributes']['class'][] = Html::cleanCssIdentifier('block-' . $variables['elements']['#plugin_id']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.