Is the discourse-tagging plugin fit for my use case?


(William Di Luigi) #1

My use case is this:

  • In the main site there are a number of programming tasks which can be solved by users.
  • A user can decide to open a topic (the possible categories are: “Help”, “Clarifications”, “Languages”, …), and the topic will either refer to a task or not.

So I was thinking about creating a discourse tag for each task, and then linking to http://forum.example.com/tags/<name> from the task page in the main site.

Is the discourse-tagging the right tool for the job? My concerns are:

  • No topic would ever have more than 1 tag.
  • If a real need for tags ever arises in the forum, I will already have “wasted” the plugin on this. To this, I see two potential solutions:
    • (easy) Just prefix each “task tag”, like this: t:mytask or task:mytask, for a task named mytask.
    • (harder?) Keep a completely separate discourse-tagging plugin (e.g. which uses /tasks instead of /tags), maybe even using different colors (e.g. standard black for normal tags, blue for “task tags”).
  • The number of tasks in the main site is currently 200+ but it’s bound to increase over time.

What do you think?


(Erlend Sogge Heggen) #2

Is there any particular reason why you can’t just use sub-categories for this? e.g.

  • Programming Tasks
  • Help
  • Clarifications
  • Languages

(Rafael dos Santos Silva) #3

I would go with tags.

If in the far future you need real tags some CSS customization will be enough. Tags plugin create a css class for each tag, it’s great!


(William Di Luigi) #4

I would like to add a link from the task page (in the main site) to the list of topics that relate to the task. For example, let’s say that there’s a task named “rugby”. When a user visits example.com/task/rugby they will see the task statement and a link that points to forum.example.com/tags/rugby so that, when they click on it, only these topics will be listed:

  • (category: Help) What is wrong with this solution?
  • (category: Clarifications) Could there be a mistake in the statement?

No other topics should be listed, apart from the topics that relate to that specific task.


(Rafael dos Santos Silva) #5

I think it will work well this way!


(William Di Luigi) #6

Yeah I think too :smile:

I just wasn’t sure if it was too much of an “abuse” of the tag system :slightly_smiling:

However, it’s great to know about the tags’ CSS classes. It’s just a bit annoying if you have two separate tag sets (e.g. 200+ task tags and 10+ normal tags) because you have to manually add every tag from a set (the normal tags in this case because they’ll likely be fewer) to a CSS stylesheet. It would be great to have something like a “tag type”, so that instead of:

<a href="/tags/rugby" class="tag-rugby discourse-tag simple">rugby</a>
<a href="/tags/normaltag" class="tag-normaltag discourse-tag simple">normaltag</a>

I could have:

<a href="/tags/rugby" class="tag-rugby discourse-tag tagtype-1 simple">rugby</a>
<a href="/tags/normaltag" class="tag-normaltag discourse-tag tagtype-2 simple">normaltag</a>

Thus keeping a cleaner CSS stylesheet (and more maintainable, for when you add a new tag).


(Rafael dos Santos Silva) #7

Use a preprocessor to generate the CSS, then add the result to the discourse. This way managing the CSS will be a breeze :thumbsup: