1

I need to remove the "Menu" tab in the mobile menu but keep the "Account" tab in place.

In my theme's default.xml file, I tried adding the following, but it breaks the mobile menu hamburger button. Clicking the button will no longer show the menu.

<referenceContainer name="page.top">
    <referenceBlock name="store.menu" remove="true" />
</referenceContainer>
  • might be easier to just hide it using css – subroutines Aug 16 '17 at 0:38
  • you can use display='"false" instead of remove="true" – Sejal Shah Aug 16 '17 at 8:57
  • @SejalShah Using display="false" didn't seem to matter. – Brad Aug 16 '17 at 14:12
  • @subroutines I think you may be right. I'll post the CSS-based solution. – Brad Aug 16 '17 at 14:12
3

This is the CSS-based solution to hide the Menu tab in the mobile menu:

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
    .nav-sections-items {
        .section-item-title[aria-controls="store.menu"] {
            display: none;
        }
        .section-item-title[aria-controls="store.links"] {
            background: transparent;
            border-bottom-width: 0;
        }
        #store\.links {
            display: block !important;
            margin: 0;
        }
        #store\.menu {
            display: none;
        }
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.