You are here

function menu_minipanels_preprocess_menu_minipanel in Menu Minipanels 7.2

Prepare minipanel variables for the template layer.

File

./menu_minipanels.module, line 255
Menu MiniPanels provides a flexible "mega menu" solution for Drupal by allowing a minipanel to be associated with a Drupal menu item. When that menu item is hovered, the minipanel content will be shown using standard CSS :hover techniques…

Code

function menu_minipanels_preprocess_menu_minipanel(&$vars) {

  // Create a rendered minipanel based on the provided minipanel_name
  $panel = panels_mini_block_view($vars['minipanel_name']);
  $vars['minipanel'] = $panel['content'];

  // Remove default class added by Drupal, which messes up our theming.
  unset($vars['classes_array'][0]);

  // Add our custom classes.
  $vars['classes_array'][] = 'menu-minipanel-panel';
  $vars['classes_array'][] = drupal_html_class('menu-minipanel-' . $vars['minipanel_name']);
}