After Update Removed Category Suppress Option, CSS Doesn't Hide Them on Mobile

(Carey B) #1

A recent beta update removed the check-box ability to suppress certain categories from the home page because it was interfering with the “Latest” view.

I use Discourse for an interactive narrative experience that has distinct in-world and out-of-world elements. Right now a bunch out-of-world categories are littering my in-world front page in mobile view.

I used this helpful post to hide the offending categories in desktop view:

But it doesn’t seem to work for mobile. I’m curious if there’s a way to have it also affect categories in mobile view? Any advice would be greatly appreciated.

(Kris) #2

It doesn’t look like we’re adding the data-category-id on mobile, so there’s not currently a way to target it with CSS. We should probably update that so it’s consistent.

(Carey B) #3

Thanks so much for the follow up, @awesomerobot, is there a place/person I can be directed to make that a formal request? Also curious if there’s a less clean workaround to hide them in the mean time?

(Jay Pfaffman) #4

I don’t know, but a work around that I’d try is to turn off the

Enable mobile theme

Site setting

(Kris) #5

I just pushed a fix to add the data-category-id to mobile, if you’re on our tests-passed branch (most self-installs are by default), this would be available if you update later today.

You can now hide categories on mobile using this CSS as a template

.category-list [data-category-id="2"] { 
    display: none;

How to Hide sub categories in hamburger menu