Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I have received some feedback from users of my site, saying that the mobile menu is confusing and it not easy to find. It is front-and-center, but I think not everyone understands that the little button will expand the menu. How can I add a label "CLICK FOR MENU" in the empty space to the left of the menu button on the responsive version of the menu?
Thanks!
Comments
Comment #1
bdanin CreditAttribution: bdanin commentedOne quick way would be using a pseudo element in CSS, for example:
.navbar-toggle:after { content: "Click for Menu"; }
The other way (which is probably better) is to copy the page.tpl.php into your subtheme directory and modify that.
Use this file:
bootstrap/theme/system/page.tpl.php
Copy it into a "templates" directory in your subtheme, then edit it and add:
<p><?php print t('Click for Menu'); ?></p>
Before button (line 90)
Comment #2
hockey2112 CreditAttribution: hockey2112 commentedThanks, bdanin. Your template method worked great! Here's my code and CSS, in case it might help anyone else:
By adding the menu title where I did, it becomes part of the clickable button, making it completely obvious what that button is for.
Comment #3
bdanin CreditAttribution: bdanin commentedGlad that worked for you! Marking fixed