We are trying to use this module in our custom theme but it is showing menu at the bottom of the page and when i click the menu icon, focus of the page goes to the bottom. And also in Url it show #off_canvas.

Version Tried:

Responsive_Menu - 7.x-3.6
MMENU - 8.5.14 and also tried with 8.5.0
Drupal core - 7.69
Jquery - 1.7

We have tried all the possible solutions provided as part of previous issues.

CommentFileSizeAuthor
#7 mmenu_without_horizontal-3165221-7.patch7.17 KBtanc

Comments

chitrakanagaraj created an issue. See original summary.

chitrakanagaraj’s picture

Without even placing Responsive Menu into any region menus (#off_canvas) is getting added to bottom of the html page.

tanc’s picture

To help debug can you tell me:

  1. Do you have any JavaScript errors in your console?
  2. Does the status report page say everything is installed correctly?
chitrakanagaraj’s picture

We were able to resolve the above issue by resolving jQuery conflict. but now we are getting below error so our landing page is not loading.

responsive_menu.config.js?qf79y3:15 Uncaught TypeError: Cannot read property 'position' of undefined
at HTMLBodyElement. (responsive_menu.config.js?qf79y3:15)
at Function.each (jquery.min.js?v=2.1.4:2)
at $.fn.init.each (jquery.min.js?v=2.1.4:2)
at $.fn.init.$.fn.once (jquery.once.js?v=1.2:55)
at Object.attach (responsive_menu.config.js?qf79y3:8)
at Object. (behavior_weights.js?qf79y3:61)
at Function.each (jquery.min.js?v=2.1.4:2)
at Object.Drupal.attachBehaviors (behavior_weights.js?qf79y3:59)
at Object.Drupal.attachBehaviors (behavior_weights.js?qf79y3:66)
at HTMLDocument. (drupal.js?qf79y3:593)

tanc’s picture

Priority: Critical » Normal

I've just installed a fresh site with version 7.x-3.6 of this module and the latest version of mmenu and I cannot replicate your issue.

From the error you've posted it looks like Drupal.settings.responsive_menu.position is not available in responsive_menu.config.js. The only way I can think of that this can happen is if you haven't placed the Responsive menu block on the page.

Note to self: it might be best to move that code out of the block preprocess code and into hook_page_build so that it is always available and will allow the user not to add the horizontal menu if they don't want it.

tanc’s picture

Title: Off canvas menu not working, menu displays as html list at bottom of page » Allow off-canvas menu to display without horizontal menu block
Version: 7.x-3.6 » 7.x-3.x-dev
Assigned: Unassigned » tanc
Category: Bug report » Feature request

Have updated the description of this issue as the error is occurring (in my opinion) due to not placing the horizontal Responsive menu block in a region. This should not throw errors in my opinion and a feature would be to use the off-canvas mmenu without having to place the horizontal menu, which brings it in line with the Drupal 8 version.

tanc’s picture

StatusFileSize
new7.17 KB

Can you test this patch and see if your issue is fixed (without placing the Responsive menu block)?

vistree’s picture

Hi @tank,
Same situation on my project: vertical navigation and responsive menu horizontal menu NOT in use!

Tested patch from #7 - and it works absolutly great for me. Burger menu is showing up correctly and off-canvas menu is displayed correctly respecting all the module configurations ;-)

Great work!!

tanc’s picture

Status: Active » Reviewed & tested by the community

Fantastic, thank you for reviewing and confirming the patch works. I'll issue a new release shortly.

  • tanc committed 1b87e9f on 7.x-3.x
    Issue #3165221 by tanc: Allow off-canvas menu to display without...
tanc’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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