Hey, Jen! You've created a wonderful module, thank you for it!

But menu also displays on /admin* pages and works not correctly (see screenshot).
I think that mobile menu should displays only on default theme. Patch below. Review please

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexander_danilenko’s picture

webadpro’s picture

I think the following issue would fix your problem.

https://drupal.org/node/2261067

joelstein’s picture

Here's another solution. Add this to a custom module:

/**
 * Implements hook_mmenus_alter().
 */
function custom_mmenus_alter(&$mmenus) {
  // Disable on admin paths.
  if (path_is_admin(current_path())) {
    $mmenus['mmenu_left']['enabled'] = FALSE;
  }
}

Note that it's hook_mmenus_alter(), not hook_mmenu_alter(). The documentation in mmenu.api.php doesn't match the code, in this case.

joelstein’s picture

Title: Don't display menu on admin theme » Don't display menu on admin paths
FileSize
456 bytes

Nevermind, my comment in #3 won't work. Here's a simpler patch which bypasses mmenu on admin paths.

webadpro’s picture

I actually think if #2 would be commited would fix all these issues.

Jay.Chen’s picture

Status: Needs review » Fixed

Thanks danilenko_dn and joelstein. The hook has been corrected to hook_mmenu_alter on the version 7.x-2.0.
So, now you can disable the mmenu on the admin page like this:

function hook_mmenu_alter(&$mmenus) {
  // Disables left mmenu on some specific pages.
  if (arg(0) == 'admin') {
    $mmenus['mmenu_left']['enabled'] = FALSE;
  }
}

For more info, please read: https://www.drupal.org/node/2324139

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

couloir007’s picture

With AMP, it would be nice to control which theme the mobile menu is inserted to. This does the trick for me.

function hook_mmenu_alter(&$mmenus) {
  // Disables left mmenu on some specific pages.
  global $theme;
  if ($theme != 'default_theme') {
    $mmenus['mmenu_left']['enabled'] = FALSE;
  }
}