You are here

function we_megamenu_preprocess_html in Drupal Mega Menu 8

Same name and namespace in other branches
  1. 8.x 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;
    }
  }
}