In many cases, it’s very useful and rigorous to set a topic under many categories. Is it possible to do so with Discourse?
No. You’d need to use the tagging system for something equivalent and that would have no hierarchy.
Would Pinning Globally work?
Hello
I’m curious to know what are the technical limitations for this.
An example of my use case would be:
- a topic titled “Local cuisines from Location A are generally saltier compared to local cuisines from Location B”
- where Location A and Location B are category names
- there is a poll with options
Agree
,Neutral
andDisagree
- being able to save the topic under both categories allows syncing of conversations and votes between both categories from day 1 (or hopefully within a few days of topic creation), instead of a reactive approach of only merging duplicate topics after the issue went viral)
- a cool codename for this could be
anti-cross-categories-topic-duplication-feature/plugin
lolz
My first thought was to create a middle table in db. Lolz so low level
Probably some better solutions could be
- add a model class reference or association
- index a list of topics associated with a category in db and call a method to bundle those topics when calling
@category.all_published_topics
or something
So yeah just wanted to know if there’s a strict technical no-no regarding this issue before I dive in deeper
Well that’s straightforward to identify, take a look at the source code, it’s very fundamental to the design:
It’s a major functional pillar.
This single integer attribute is all over the model code, API, back end processes and UI. Assumption that there is only one in dozens of Theme Components and Plugins too, I imagine.
You’d have to be very brave to try and change such a core design/assumption and it would be a lot of work, and you’d probably not be able to use many of the extensions available in the ecosystem.
You’d almost certainly find it a lot of work/economically impossible to ever upgrade the instance, too.
Can I suggest you use tags instead of a category?
A topic can have many tags and so can appear in many tag lists.