Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I really like the off-canvas menu. It works with Nice Menus but in order to make it work, I had to make a couple of edits so I'm not sure that I'm doing this right.
In screen.scss, I changed .main-menu
(lines to 383 and 407) to #block-nice-menus-1
since that appears to be the id that Nice Menus creates when you assign a Nice Menu to a block.
In script.js changed line 38 from
$('.main-menu').toggleClass('open');
to
$('#block-nice-menus-1').toggleClass('open');
then the off-canvas menu worked beautifully. Is there a more efficient way to do this? Thanks.
Comments
Comment #1
nicxvan CreditAttribution: nicxvan commentedThis didn't work for me using superfish and replacing .main-menu with #block-superfish-2
Comment #2
jpamental CreditAttribution: jpamental commentedHey Stan -
I forgot to include that I was using the 'block_class' menu to add a .main-menu class on the block itself. If you do that, then this should work as-is.
Comment #3
jpamental CreditAttribution: jpamental commentedNic - I haven't looked at what classes are added by the Superfish module versus Nice_Menus - but I bet we could work it out. I'll take a look!
Comment #4
stanb CreditAttribution: stanb commentedJason,
Your solution in #2 worked. I installed the Block Class module, added the class
main-menu
to the block, and it works as advertised. Thank you!Stan
Comment #5
jpamental CreditAttribution: jpamental commented(theme requires the block_class module - explanation given above)
Comment #6
nicxvan CreditAttribution: nicxvan commentedSeems that the latest reworking breaks the off canvas menu.
I have the main-menu class set using block class and nice menu in the navigation set up. It's a subtheme from the starterkit.
I have this working on another site, same set up. I've tried both locally and remotely but the off canvas menu does not appear when clicking the link.
Comment #7
jpamental CreditAttribution: jpamental commentedIt may just be in the child theme - I need to update the CSS there a bit. Will look into it as quick as I can.
Comment #8
nicxvan CreditAttribution: nicxvan commentedI haven' tbeen able to see what's up yet, you may want to look at the issue I just added and related here cause it may be the same thing, something is happening with inheritance of the theme it looks like.
Comment #9
nicxvan CreditAttribution: nicxvan commentedComment #10
jpamental CreditAttribution: jpamental commentedFixed in latest dev commit. Needed to rename base theme JS file (it wasn't loading because it was named the same in the child theme)
Comment #11
nicxvan CreditAttribution: nicxvan commentedConfirmed.