Force users to select a sub-category?

The users of the forum I’m importing would like to have a parent category that serves as a “label” (similar to what they had on phpBB). A category that contains nothing but subcategories. No topics in the parent category.

I’m very well aware that this is not how Discourse categories are intended to work. But it’s not always easy to find new ways of reorganizing categories from an older forum engine that has a different category structure, and my users are satisfied with the current reorganization, despite an “issue” that I’ll describe later (see the paragraph with the video).

The parent category contains 4 sub-categories.

The easy way to force users to post in a sub-category is by unchecking “Create” in the Security tab for “all”, and adding a custom text to be displayed when users don’t have the rights to create topics in this parent category.

However, an issue is that the button New Topic is greyed out, with a :no_entry_sign: symbol on hover, which is really not inviting.
If we click on it (despite nothing let us know we can actually click it because of the icon), we have our custom message (for example: “Please select a subcategory to post a topic”), which is also present on top of the category page (the top line in the video).

I suppose there is an easy JS way to remove the disabled class on this particular button?
But even if we do so, another issue is that users expect that when they click an inviting button (normal state, pointer cursor), they have a message editor, not a message saying “please click one of the subcategories in order to create a topic”. Do you think this will be a deterrent since the forum is aimed to draw new people and not only made for current users?
Or maybe we can completely hide the button… Which could be weird since the New Topic button will be present in other parent categories that are allowed to have topics?

Would you strongly advise finding another organization of categories that allows the parent category to be a regular category with its own topics and not a “label”?

What is your advice?

2 Likes

What if you add the subcategories links in the modal or with the new topic link?

For example:

Please choose a subcategory below to create a new topic.

<a href="/new-topic?category=parent/subcategory1">Subcategory1</a>
<a href="/new-topic?category=parent/subcategory2">Subcategory2</a>
<a href="/new-topic?category=parent/subcategory3">Subcategory3</a>


And you can modify the button with css. Like this

#create-topic {
  &.btn[disabled]:not(.is-loading),
  &.btn.disabled:not(.is-loading) {
    opacity: 1;
    cursor: pointer;
    &:hover,
    &:focus {
      background: var(--primary-medium);
      color: var(--secondary);
      svg {
        color: var(--secondary);
      }
    }
  }
}
1 Like

There is a couple of interesting ways to organize something like this.

Use Tags as a Subcategory instead with a must use 1 tag.

Air Theme has a categoru grouping with Headers in the list.

Ie

Category Group Name Header 1

  • listed Categories

My current setup is using a parent and sub. It does create some annoysnces at times especially as admin I can post anywhere lol.

In Parent I keep See permission with subs hsving full permission.

Category hider theme component works well to cleam up Hamburger so it only shows parent categories.

I think i want something like this… actually what i want is a way less noisy discourse… is it possible to hide all topics of subcategories when browsing a category?

It would require a custom theme component or maybe even a plugin.

As for the topic, we ended up keeping the default behavior.

I can code it. i feel that discourse is super noisy in somethigs. already removed the “suggested topics” with css… and trying to make it more readable for people which have hard times to use technology. they complain they can’t find stuff… im still confused how-to make their life easier. they are used to google docs and whatsapp… but that’s horrible.

my feature request is that instead of showing a list of posts… when i open a category should show a list of sub categories… and under a list of posts of this category… to see the posts of the subcategory you should open the subcategory… that is so easier to map in our brains… id say

I understand it :slight_smile:

The potential overwhelmingness for new users was also discussed here:


If you have a feature request, please post it in feature as this topic was dedicated to forcing users to select a subcategory when the want to create topics in certain categories. :slight_smile:

If you know how to achieve what you want (or if you have questions to do so), feel free to share this in dev, it can also be helpful for others :slight_smile:

Just to add a bit of information about the forced subcategory selection.

I saw this post when I was looking for a solution:
Minimum category / sub-category dept level to post a topic - #3 by rbrlortie (the solution isn’t necessarily what I wanted, and is outdated)

I registered to @rbrlortie’s forum last year out of curiosity and I saw that when I was in a parent category, the category selector was pre-filled with a default subcategory, which was nice. But I looked at it today, and it doesn’t work like this anymore.

2 Likes

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