Off topic categories not in recent lists?

Hello. I’m not sure if this feature exists or has even been suggested as I’m having trouble researching exactly what I’m thinking of.

My wish would be to have one or more categories that don’t show up in the Topics or Recent Posts lists, but still get a discreet notification.

To be clearer, here’s what I have in mind: I’m an administrator of a discourse site, and one of the categories of my site is called “Coffee break”, which is used, as is often the case on forums, to deal with subjects that aren’t related to the site’s theme.

I’d like the topics published in this off-topic forum not to appear in the lists of recent topics, but to be the subject of a discreet notification like, for example, a count of the number of new topics or maybe even a message at the top of the site below the header saying something like Coffee break: 3 new topics.

I don’t think there is a built-in way of doing this, but you could try hiding topic list items from a specific category with CSS using something like this (replacing x with the category “slug” from category settings):

.topic-list tr.category-x {
    display: none;
}

However, this would make them disappear from any topic list, meaning to topic list for that category would just be blank! So remedy this, we could exclude the code CSS from affecting the category page like this:

body:not(.category-x) .topic-list tr.category-x {
    display: none;
}

If you also want them to show up when the users search for a particular tag, you could add that as well:

body:not(.category-x):not(.tags-page) .topic-list tr.category-x {
    display: none;
}

This would probably require a custom component. There might be an existing theme-component that could do something like that, but I can’t think of one off the top of my head!

1 Like

Thank you very much ! It remains to see if others have the same need, so that the functionality could be created as a component.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.