能否仅检查每个类别的重复主题标题?

First of all, I would like to say “thank you very much” to the Discourse team. You had a great, smart and interesting forum. We are using the Discourse as a platform for our website :smiley: Then we have one case that needs your help.
Currently, the Discourse doesn’t allow users to create 2 topics which have the same topic title although they are in different categories. So do we have any solutions for this validation applied for the unique category, not across the system?
Example:
User A created a topic with the topic title “Discourse is a great system” in the category 1
=> User B can NOT create a topic with the title “Discourse is a great system” in the category 1 but he CAN do it in the category 2

I hope to see your answer soon. Thanks once again.

Glad to hear Discourse is working well for your website :smiley:

If you want to allow topics to have duplicate titles, you can enable the allow duplicate topic titles site setting. In general though, we recommend keeping it disabled, as having duplicate titles can be confusing for users and potentially search engines.

Unfortunately we don’t have that functionality, it is just on or off across the whole system.

为了进一步说明 @david 所说的内容,如果你查看 URL 的构造方式,会发现类别并不包含在 URL 中:

https://example.com/t/topic-title/1234

因此,如果两个不同类别中存在重复的标题,URL 将会非常相似——当然,除了 ID 编号之外。

@david and @codinghorror Thank you very much for your support.
The reason why I would like to check the duplicate titles for each category, not all. Because on our system, all categories are private and each category will match to one group. So the condition for viewing, searching the topic in a category is that he needs to be a member of a group matching the category.
If we check the duplicate topic title and users don’t see the topic that has the same title in the category (on our system, it works as a community). It makes the users confused.
Currently, our temporary solution is to “allow duplicate topic titles” on the setting. But if our website is bigger, allowing the duplicate topic title is not good.

我同意,如果类别不同,应该允许使用相同的标题。这将是一个巨大的优势。

这是否难以实现?

场景是:用户无法访问所有分类。如果主题标题在用户无权访问的分类中已被使用,却收到“主题标题已被使用”的失败提示,这会令人困惑。

因此,最好提供三种状态:
无重复标题
同一分类内无重复标题
允许不同分类中存在重复标题

如何处理 https://github.com/discourse/discourse/pull/10034?

@minh_tri_Phan YI:该提交已于今日合并。