I have set my main navigation to use Menu Minipanels. Unfortunately this is also causing my Site Map page which renders the main menu links to also trigger the Minipanel.

Does anyone have any suggestions as to how I can unattach Mini Panels from my Site Map links? I'd like to avoid using javascript to fix this if possible.

This issue seems very similar to #1758866: minipanel should not be displayed in the breadcrumb but with Site Map links instead.

Comments

i_g_wright’s picture

Hi yeebot,

I have come across the same issue.

I know you don't want to rely on JS but the minipanel is actually only ever going to show if you have JS enabled, an easy way to fix the issue with JS is as followed.

// Remove the qTip from our site map
$('ul.site-map-menu li a').hover(function() {
  $('.qtip').qtip("disable");
}, function() {
  $('.qtip').qtip("enable");
});

Hope this helps,

yeebot’s picture

Thanks @i_g_wright... I gave it a go but struggled to get it to work properly, perhaps because my minipanels are triggered on click rather than hover.

I did a bit of further investigation and found that there is a sitemap function that I can hook into to remove the minipanels from my links. I've used the following and it seems to work nicely!

/**
 * Implements YOURTHEME_menu_site_map_menu_link().
 * Fix: Make sure the menu_minipanels module does not attach the qTips function
 * to any sitemap links by removing the menu_minipanels_hover 'flag' from menu items.
 * See issue: https://drupal.org/node/1758866
 */
function YOURTHEME_site_map_menu_link(array $variables) {
  $element = $variables['element'];
  $sub_menu = '';

  // Unset Menu Minipanels from the Sitemap
  if (isset($element['#localized_options']['menu_minipanels_hover']) && !empty($element['#localized_options']['menu_minipanels_hover'])) {
    unset($element['#localized_options']['menu_minipanels_hover']);
  }

  if ($element['#below']) {
    $sub_menu = drupal_render($element['#below']);
  }
  $output = l($element['#title'], $element['#href'], $element['#localized_options']);
  return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n";
}
i_g_wright’s picture

Status: Active » Fixed

Hi yeebot,

Ohh, nice one!

Thank you for sharing the code.

* Closing ticket as fixed...

Kind regards,

i_g_wright’s picture

Status: Fixed » Active