是否可以创建子子类别?

Is it possible to create subcategories within subcategories? For example, can I have a grandparent category, parent subcategory, and child subcategory? If not, is there any alternative to creating a separate instance for each “grandparent”?

4 个赞

No, there are only two levels of categories in Discourse.

We’ll combine the 2 levels of categories with tags. It’s not just about taxonomy, it’s also about moderation rights.

Will 3 levels of categorization be possible in the future? My site is about 4 sports, then within each sport, I want a category called “Gear”, and then within “Gear” have the different brands.

I could also do a top level category called Gear, and then have the Gear Companies underneath.

Or just have the Gear companies for each sport listed directly under the sport.

1 个赞

No plans for more than 2 levels of categories. As @jeans noted, adding tags into the mix makes more sense at that point. So use the official tag support built into Discourse.

5 个赞

@codinghorror What would be the technical implications of allowing deeper nesting of categories? I don’t have a specific requirement in mind, just curious. I can see UI concerns, but the data model looks like it could handle chains of parents.

Here a typical case where we need to configure Discourse with 3 levels,
Local Groups - Open Knowledge Forums

the local-groups are in fact the “level zero”, in some cases we also change language (!), as at local-groups/okbr. The main topics are at this level-2, it is ok, but…

The level-3 is important to isolate very distinct topics and/or communities:

  • to isolate official topics. Example: today we use the “official” tag as here, but we need to isolate as local-groups/okbr/oficial,

  • to isolate projects, because they have independent communities and very specific topics. Example: this project was losted in an external category, openspending/gastos-abertos, we need an intersection between openspending and local-groups/okbr and we understand that the second is the priority, so need category local-groups/okbr/prj-gastos-abertos that is a typical “local group project” category.

这很有趣:你似乎认为任何现有知识领域都只能按一级类别划分,而不能按二级或更高级别划分。虽然我不清楚你的具体理由,但对我来说,很难相信这会是事实。

是两级,而不是三级。而且 我们并不是唯一这样认为的人

6 个赞

如何实际标记一个类别?

您好,感谢您提供的出色的讨论工具和社区。我想了解是否有可能动态创建子子类别?如何使用标签来实现?

试试这个

1 个赞

现在您可以创建子类别了,只需将父类别设为您想要在其下添加子类别的类别即可。

1 个赞

现在可以通过隐藏的站点设置更改子类别的级别:

cd /var/discourse/

./launcher enter app

rails c

SiteSetting.max_category_nesting = 3

7 个赞

他指的是子子类别,也就是第三级,而不是第二级(子类别)。

2 个赞

好的。这个隐藏设置使得创建子子类别(三级,因此设置中有个3)成为可能。我想它已经存在一年了,但添加时并没有引起太多关注(它只是出现在了发布说明中,但可能没有标题)。我猜一定有企业客户想要这个功能,但他们仍然认为这是一个糟糕的主意。:wink:

5 个赞

我从未尝试过创建子子类别,是否无法通过用户界面创建?

启用该功能后即可实现。将父级设置为子类别,而不是父类别,即可创建子子类别。

这是创建子子类别时创建类别屏幕的外观:

我不记得最初是谁要求的,但我们大约在一年前在 NaNoWriMo 论坛上要求启用它,希望它最终能帮助解决我们一个更大且有些独特的问题。

它解决了我们的测试用例问题,但可悲的是,除了奇迹之外,没有什么能解决另一个问题。 :slight_smile:

3 个赞