Disabling categories

I would love ability to disable categories. My forum has only around 3-5 new topics a day. There is just not enough traffic to justify categorization of new topics.

So basically I’m thinking of some switch in settings that would allow to hide Category column, All Categories button and basically any UI element to do with categories. I know I could do it with CSS but there is no guarantee future updates don’t break it.

Would you agree that for small forums, category feature is unnecessary overhead and contributor to unjustified UI clutter?

3 лайка

I agree completely that on a small forum (and to be honest even the medium sized ones) categories are pointless mental overhead. The common risk is over-categorization more so than not enough:

But hiding the topic list category column in css should be fine and I cannot think of any reason that would easily break in the future.

Glad I’m not the only one. I’ve added following CSS definition to my stylesheet to hide categories.

th.category,
td.category,
a.badge-category,
div.category-input,
ul#category-filter li:last-of-type
{ display: none !important; }
2 лайка

You mean as a customization in the admin panel, not editing the stylesheets… right?\

:wink:

Yeah, I’ve inserted CSS through admin panel.

I can’t get @lubos’s solution to work with the current Discourse version. The reason is that pinned topics has:

  • no category column,
  • a first column with colspan=2.

So when hiding td.category, the resulting table has pinned topic’s rows larger than other rows.

I’ve tried to hide the second column with td:nth-child(2), but it has the drawback of hiding pinned topic’s authors (plus maybe it’ll break on mobile).

Since 2014, has another solution to disable categories on small forums been implemented or figured out?

Hi @jack2, try this to disabling categoriers on the topic list and on the hamburger menu:

.topic-list .category.sortable, .topic-list .category, .category-links.clearfix {
    display: none;
}

If you want to disable the category box when a user open a new topic add this element too:

.select-box .select-box-header

2 лайка

Thanks @Trash, but it doesn’t work well for the reason I’ve explained earlier. Here is what your CSS looks like with a pinned topic:

Mmm I don’t see that issue with pinned topics. Let me see in my test site, where I have the Welcome topic…

@jack2 that particular topic is without category (uncategorized).
The simplest fix is to move it in a category otherwise you have to create other css code for targeting pinned topics without category

5 лайков

Hi @Trash,

How can I disable the categories menu too?

image

.list-controls .category-breadcrumb .has-drop.box { display: none; }

4 лайка

Does anyone knows how to hide categories for all users but staff. Use case: a new site without a lot of posts, but the admin can start categorizing posts right away, for the future.

There is a .staff class in the body tag. I was trying using the : not (X) property but I wasn’t able tho achieve it.

Maybe using SCSS?

Привет @dax, из этого работает только удаление категорий из меню-гамбургера, в остальном они не функционируют. Есть какие-то предложения?

Через два года классы и селекторы, использованные в приведенном выше CSS, будут изменены. Попробуйте использовать

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

чтобы скрыть категории с главной страницы.

5 лайков

Кто-нибудь удавалось настроить нативный CSS… в отличие от дополнения нативного CSS пользовательскими стилями для скрытия нежелательных элементов?

Интересно узнать чей-либо опыт или рекомендации. Предполагаю, что такой подход сэкономит мне байты на фронтенде, но потребует глубокого вмешательства в ядро Discourse после каждого обновления ПО?

1 лайк

Да, я тоже думаю, что было бы очень круто и полезно иметь такую «настройку» в настройках для каждой категории отдельно. Что-то вроде «Скрыть категорию от всех, кроме Stuff».

1 лайк

Администраторы могут установить категории по умолчанию, которые будут отключены в настройках администратора, default categories muted.

Вы можете настроить права доступа для каждой категории, нажав на гаечный ключ администратора в правом верхнем углу страницы этой категории и перейдя на вкладку «Безопасность». Там вы можете настроить так, чтобы доступ к просмотру, ответам или созданию имели только определённые группы.

Также существует этот компонент темы.

2 лайка