- This topic has 9 replies, 3 voices, and was last updated 2 years, 2 months ago by Ying.
-
AuthorPosts
-
September 16, 2022 at 5:44 am #2344769Malik Merchant
I have created 2 menus
#1) Primary Menu
#2) Off-Canvas Panel OverviewBoth the menus are showing up on the Desktop as expected BUT the issue is on the Mobile screen, where only menu #2 (Off-Canvas Panel) is showing up.
I have set: Customizing > Layout Off Canvas Panel > On (instead of Mobile Only & Desktop Only)
What I understand is both the menus will be visible on the Desktop because there is a lot of space & it’s not practical to show 2 menus on Mobile.
In that case, I want to create a new menu (let’s say “Mobile Menu”) that contains all the links of the Primary + Off-Canvas Panel so that I can show it all in 1 drop-down on the mobile screen.
But there is no option to create & assign a dedicated menu for Mobile navigation.
Am I missing something here?
Any idea/custom code/hack to assign a dedicated menu to Mobile only?
Thanks!
September 16, 2022 at 7:53 am #2345010DavidStaffCustomer SupportHi there,
theres a few ways, one way would be to:
1. your current Off Canvas Menu add that to the Widget > OFf Cavas using a Navigation Menu widget.
2. assign the primary menu items to both the Primary Navigation and the Off Canvas panrel.
at this point you should see on desktop the current layout you have.
but in the off canvas panel you will see your primary menu and your widget menu3. Add this CSS to remove the primary menu in the Off cavnas when viewed on desktop:
@media(min-width: 1024px) { #generate-slideout-menu .main-nav { display: none; } }
September 16, 2022 at 11:19 am #2345177Malik MerchantThanks, David for the update. The exact code didn’t work but the idea did!
This is what I created & it works fine – excelpt 1 issue
@media(min-width: 1024px) { #generate-slideout-menu .main-nav, #nav_menu-6, #menu-off-canvas-menu, .slideout-navigation .slideout-menu { display: none; } } @media (max-width: 768px) { #generate-slideout-menu .main-nav { display: none; } } .slideout-navigation .main-nav, .slideout-navigation .slideout-widget:not(:last-child) { margin-bottom: 0px; }
Issue: The drop-down menus are not working in the Off-Canvas Menu, so the user won’t be able to access the sub-menu items
Example: Membership > Free & Pro (working in the Desktop main menu but not working in mobile Off-Canvas Navigation)
Any suggestion on how to fix this issue?
Thanks for the help again David
September 17, 2022 at 3:07 am #2345589DavidStaffCustomer SupportThe menu you added to the Off Canvas location, it doesn’t have a sub menu – did you add those child items to that membership menu item ?
September 17, 2022 at 3:41 am #2345607Malik MerchantYes David, the sub-menu items are there but not showing up in any of the OfF-Canas Menus (Desktop / Mobile)
September 17, 2022 at 11:50 am #2346014YingStaffCustomer SupportHi there,
The sub-menu of the membership menu item is hidden by this CSS:
#generate-slideout-menu.main-navigation ul ul { display: none; }
As you have the cache plugin on, I can’t see where the CSS is from.
Can you check if it’s added by you? If you are not sure, can you disable your cache plugin so we can check?
September 19, 2022 at 6:28 am #2347339Malik MerchantHi Ying, I turned off the cache plugin, can you please check now & suggest?
I have not added that code in the Custom CSS for sure, just double-checked.
September 19, 2022 at 11:15 am #2347750YingStaffCustomer SupportOh I see, the menu items are added using navigation widget, in GP off canvas menu, the sub menu will be hidden by default until you toggle its parent menu item.
But the navigation widget doesn’t have this function, so the sub menu can not be shown in this way.
Try add this CSS:
#generate-slideout-menu.main-navigation .widget_nav_menu ul ul { position: relative; top: 0; left: 0; width: 100%; display: block !important; height: auto; overflow: visible; opacity: 1; pointer-events: auto; }
September 20, 2022 at 1:54 am #2348197Malik MerchantThat worked! Thanks, Ying & David.
Is there any place where I can submit this as a feature request?
Would love to see this feature as default in the coming update if possible.
Thanks again,
MalikSeptember 20, 2022 at 9:40 am #2348684YingStaffCustomer SupportYou can open an issue as feature request in GP premium’s Github: https://github.com/tomusborne/generatepress 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.