dropdown in navigation?
-
@baris said in dropdown in navigation?:
This will be available in our next release. https://github.com/NodeBB/NodeBB/issues/9967
Hi @baris , is there any way to re-group several navigation items into one as a dropdown menu while maintaining their visibility settings?
we have several plugins that use navigation bar such as:
/map
/calendar
/feed
/glossary(some are for registered users only and opens in a new window)
So, the navigation bar is getting crowded, I wonder if there is any way to implement this?
-
No built in way to do it. But you can control the visibility of the dropdown menu items via custom css.
Here is a sample dropdown that shows an item for logged in users and a different item for guests.
<li class="loggedin"><a href="https://somelink.com">visible to logged in users</a></li> <li class="guest"><a href="https://otherlink.com">visible to guests</a></li>
Once you create a dropdown like that you can control the visibility via custom css. The body element is given a class based on the user's logged in status.
user-loggedin
if they are logged in anduser-guest
if they are logged out.So in your custom css you can use those classes.
#main-nav .dropdown-menu .loggedin, #main-nav .dropdown-menu .guest { display: none; } body.user-loggedin #main-nav .dropdown-menu .loggedin { display: block; } body.user-guest #main-nav .dropdown-menu .guest { display: block; }