Topic: SideNav submenu active
m.hamacher priority asked 5 years ago
Hello,
How can I set an submenu item active in SideNav?
I can set the main items active by adding the class active or current. But when I add this to a submenu item there is no style change, so that it is not indicated on which page I am.
I tried adding the class to the li-tag as well as to the a-tag.
Kind regards.
Marta Wierzbicka staff answered 5 years ago
Hi,
we need to add this to the documentation but try code from this snippet (it works only in the newest 4.7.1 package): https://mdbootstrap.com/snippets/jquery/marta-szymanska/340350.
Best, Marta
Anna Morawska staff answered 5 years ago
Hi there,
right now there is no such option, but we will add it to our TODO list. Thanks for the suggestion, we appreciate this.
Best,
Ania
Anna Morawska staff answered 5 years ago
Hi there,
you can try to add mask to the active li element, for example:
<li class="mask rgba-blue-light">
<a href="#" class="waves-effect">FAQ</a>
</li>
The complete list can be found here
Best, Ania
m.hamacher priority commented 5 years ago
Hi Ania, first of all thanks for the tip. But thats not really what I'm searching. I thought maybe there is a class I missed, which automatically marks the link active as it is with the active and current class for the first menu level. My thought was, that it should look like in the seidenav of this site. There the active submenu links have the primary text color. For now I will use the text-primary class to indicate the active submenu, but maybe it can be implemented in a further version that you can use .active or .current within submenus.
Best, Matthias
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB jQuery
- MDB Version: 4.6.1
- Device: MacBook Pro
- Browser: Chrome
- OS: macOs High Sierra
- Provided sample code: No
- Provided link: No