I want the logged out user interface as simple as possible so I was wondering if I could hide tags and badges from the hamburger Menu only for guests.
I know this can be done easily with CSS from this post -
But how do I check for the condition that user is a guest and then hide menu items? I probably need to call a function to check this ( just like WordPress) but I have no idea how that would work in Discourse. Can someone please help?
This worked like a charm. Thank you! Only thing left to hide is the tags link but it does not seem to have itâs own class. How do I target it? With widget-link class it hides the About, FAQ and Mobile View links.
Perfect. This is the final code that worked. I also hide the separator bar. Thank Jammy!
/*hide tags and badges link from hamburger menu for guests */
.anon {
.hamburger-panel .menu-panel {
a.latest-topics-link,
a.top-topics-link,
a.badge-link,
li a.widget-link[href="/tags"],
.menu-container-general-links
{
display: none
}
}
}