function we_megamenu_preprocess_html in Drupal Mega Menu 8.x
Same name and namespace in other branches
- 8 we_megamenu.module \we_megamenu_preprocess_html()
Function we_megamenu_preprocess_html.
File
- ./
we_megamenu.module, line 793 - Drupal 8 Mega Menu Module.
Code
function we_megamenu_preprocess_html(&$vars) {
$current_path = \Drupal::service('path.current')
->getPath();
$need_path = 'admin/structure/we-mega-menu/';
if (strpos($current_path, $need_path) !== FALSE) {
$vars['attributes']['class'][] = 'we-mega-menu-backend';
$backend_style = \Drupal::state()
->get('we_megamenu_backend_style') ?: '';
if (!empty($backend_style)) {
$vars['attributes']['class'][] = $backend_style;
}
}
}