Skip to main content
Solved

Hide topic count in menu

  • 20 May 2024
  • 5 replies
  • 54 views

Hey Community experts! 👋🏼 Is it possible to hide the ‘count’ of topics/articles in the main navigation dropdown menus? Use case: In order to free up some real estate in the main nav, we created a redirect to Product Updates within the Knowledge Base menu (retitled to Resources in our example). While this is a ‘real’ category created to achieve the redirect, it doesn’t and won’t have content, so in the dropdown view, it appears as 0 - not ideal. I’d love to hide the counts altogether but haven’t found where I can do this via control. Will I need custom CSS to do this? 

 

CC: @Julian @MeghanM @echen 

5 replies

Userlevel 5

@cclements  ok, I haven’t tested this exhaustively, so I suggest you try this out in a sandbox first. But you can use this CSS in your “Custom CSS” to remove the numbers from being shown….

 

[id^="mega-menu-category-"] > span.text--meta {
display: none;
}

I quickly tested it and it certainly removes the numbers in the menu. However, you’ll want to check all of your pages to make sure if the CSS needs to be refined a little more.

Userlevel 3
Badge +3

This looks like the correct solution - however I am also not a CSS expert, so please test this on your staging environment and let us know if it helped! 🙂

Userlevel 4
Badge +1

Normally as the admin you see categories with 0 articles. but as the user, you won’t see empty categories.  

Userlevel 2
Badge

Brilliant - thank you so much @rhall! Worked beautifully!

Userlevel 5

Not a problem @cclements.

You can try stuff like this out for yourself if you know a few tricks. If you do, ignore this. If not, just right click on an HTML component and select “inspect” (in Chrome). It will bring up the DevTools popup. Have a look around here. You can make changes to CSS to try stuff out and really understand what is wrong, without making any changes to your Community. Whenever I want to make a change to the UI which isn’t a built in option, I play around here. However, be careful to fully test your ideas in your sandbox before actually publishing them ;-)

Reply