Configura il tagging strutturato con gruppi di tag e restrizioni sui tag di categoria

Tag support is a core feature of Discourse. In this How-To I’ll go through setting up a tag schema like Car Talk uses.

We’ll want to achieve these things:

  • Tags for car makes and car models.
  • Only allow the car make and model tags to be used in certain categories.
  • Car model tags can only be chosen if the matching car make tag is used.

Prerequisites

First, we need to enable tags in the settings:

In a schema where we’re strict about how tags are used, we should prevent most people from creating new tags:

Tag Groups

Go to the tags index page (/tags). Choose “Manage Tag Groups” from the top right menu.

Top-level tags

First let’s create the car make tags, which we want people to enter first.

On the tag group page:

  1. Create a new group.

  2. Give it a title.

  3. Add the tags that should belong in the group. You can add existing tags, or create new ones from this page.

  4. We only want people to use one car make tag per topic, so check the box to add this limitation.

  5. Save the group.

Parent-child tag relationships

Now we’ll define the car model tags, which are grouped according to the car makes. There will be one group for each car make.

Create another group as before with an appropriate name. This time we add a parent tag. In this example, we define the Honda car models group, and use honda as the parent tag.

The result

At this point, tagging a topic will obey these rules. When trying to add tags, the first tag can only be one of the car makes (or other tags that have no limitations on where they can be used).

The second tag can be one of the model tags matching the chosen Makes tag.

Visibility and usage restrictions

If needed, you can restrict the visibility or application permissions of tags to specific user groups:

Category restrictions

If I only want car discussions to happen in a certain category, I can restrict the use of all the car make and model tags from the category settings.

In the “Tags” tab of a category’s settings, add the groups.

If I have other categories where these tags should also be permitted, they can be added in those categories’ settings in the same way.

And that’s it!

Additional Resources


Last Reviewed by @Canapin on 2023-05-22T22:00:00Z

71 Mi Piace
Using tags instead of subcategories for a car forum
(How) Can we increase the tags limit?
Categories with allowed Tag Groups
Tagging rights for specific users?
Tagging a topic from email in
Large number of forums / categories / groups?
Is it possible to make tags mandatory?
Topic Title Flair - or something like that?
Empower moderators to restrict tag groups | Nested tag structure | Navigation bar
How might we better structure #howto?
Educating users about tags
Several questions about management right
Kanban Board
Categories vs tags: is this even possible?
Help with Tags that can only be created by the Moderators but used by everyone
Using tags to categorize city specific questions
User-defined keyword for each thread
Best practices to manage events inside a category
Default tags for users
Default tag for new topics?
Structuring an active support community migrating from Facebook
How to Find Your Community's Most Commonly Asked Questions
Best element to use for pulling featured posts
Editing topics with tag groups from parents allows incorrect tagging
How can I make sure only admins/mods are able to create featured posts?
Is it possible to make tags mandatory?
Not Able To Post New Topic Using Tags - Error
Filter Tags on change Category
Uploading Tag for specific categories
About topic tags
Tag Group URLs
Getting certain posts to Zapier
I Need a category link to take me to a tags page
Staff tags missing in settings?
Feedback on my forum
Anchors to headings do not always work
How to create a help web page for my community site in two levels
Help with Tags that can only be created by the Moderators but used by everyone