Skip to main content
cclements
Contributor ⭐️⭐️⭐️⭐️
May 20, 2024
Solved

Hide topic count in menu

  • May 20, 2024
  • 5 replies
  • 92 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 

Best answer by rhall

@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.

5 replies

rhallAnswer
Expert ⭐️
May 20, 2024

@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.

Julian
Gainsight Employee ⭐️⭐️⭐️
May 21, 2024

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! 🙂

I follow my nose, it always knows
juan.delrio
Helper ⭐️⭐️⭐️
May 21, 2024

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

cclements
cclementsAuthor
Contributor ⭐️⭐️⭐️⭐️
May 23, 2024

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

~ Courtney Clements
Expert ⭐️
May 23, 2024

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 ;-)