Show Only Categories on Mobile View

AI-generated summary

In a discussion titled ‘Show Only Categories on Mobile View’, BrianC sought a way to display only categories (without topics) on mobile, noting that the ‘Categories Only’ setting in admin doesn’t affect mobile views. MihirR provided a CSS workaround to hide topic links on mobile, which BrianC confirmed worked well. Jagster criticized the change, arguing it removes user choice and that some users prefer seeing topics under categories on mobile. BrianC countered that the mobile view is cluttered with 16 categories and 80 sub-categories, making navigation difficult. Moin questioned which user option was removed, since no preference exists for styling the /categories page. Jagster reiterated that hiding topics removes the ability to see latest topics under categories, calling the aesthetic judgment subjective. Moin suggested the intent was to mirror the desktop ‘Categories Only’ setting on mobile. Later, Moin noted that Discourse now includes a native setting to configure the mobile categories page to ‘Categories Only’, which BrianC confirmed seeing and appreciated.

Hello all,

When viewing All Categories on mobile, there are a few topics displayed above the post titles, which are shown under the category they belong to. I am using both Categories and Sub-Categories. In the admin panel, there is an option to show Categories Only, but this does not affect the mobile view. How can I configure it to show Categories Only on the mobile view?

If you want to hide the topic list below the category specifically on mobile, you can do this by going to the Edit HTML/CSS section and adding the following under the Mobile tab:

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

If you’re unsure how to edit the HTML/CSS, you can visit https://yourdiscoursedomain.com/admin/customize/components. Click on Install, then + Create New. Name it anything, set the type to Component, and then open the file you created. On the right, you will find the option to Edit HTML/CSS.

Also, make sure to enable that component for your theme. For more details, you can visit Making Custom CSS Changes on Your Site.

Works like a charm! It makes my mobile categories page beautiful. Appreciate your guidance.

Bad news are, of course, it overrides what users want and like.

@Jagster please help me understand that statement? The option in Discourse for displaying Categories Only does not display any Topics in desktop but in Mobile they remain. Not sure why it isn’t for both. Why do you say this is what the user’s want? In mobile it looks messy and takes up a lot of space and makes seeing the available categories more difficult. I have 16 categories with about 80 sub-categories. Curious for your perspective.

Messiness is only your opinion, and I could name quite a few people who prefer it this way. The main point is that you took an option away from users just because you wanted something. Similar things include forced dark mode, font size, and so on.

Using mobiles is fundamentally different from using desktops.

BTW, my category view shows topics as well. Not just plain categories.

Which option was taken away? I know you can choose a homepage in your preferences, but I am not aware of a setting to choose the style of the /categories page.

Seeing latest topics under a category. Just because it looks ugly :man_shrugging:

I think the reason is to make it resemble the desktop version. When the admin chooses “categories only” in the settings, creating the same style on mobile seems like a good idea.

Recently, a setting to configure the mobile categories page was added. You can now choose “Categories only” for mobile as well.

I noticed this last night. Nice option.