Limit category selections for topics based on tag restrictions

I have a tag named “category-specific” that should only be used within the category named “target-category”. I have added the “category-specific” tag to the “Restrict these tags to this category” list for “target-category”. When I create a new topic from the /tag/category-specific path, all categories are shown as possibilities in the category selector, and the default selected category is the “General” category. If I try to save the topic in this state, Discourse does refuse to save the topic, indicating an error with associating that tag with that topic. Would it be possible to restrict the category selector to only those categories that allow the chosen tag?

Also, the full error message is: The “category-specific” tag cannot be used in the “General” category. Please remove it. Could we adjust that to say something like “Please remove the tag or select a different category.”?

This could be a feature request, a bug report, or a support request (i.e. I might be doing it wrong), but I’ve started it out as a feature request; I’m happy to see it migrate elsewhere if it fits better there!

I can’t help with any coding that would help force the user to change their post location - but you can definitely change the warning text, as with all text on the site:
Admin > Customize > Text > Search
https://your-forum-fqdn/admin/customize/site_texts?q=category.%20Please%20remove%20it.

Change to whatever //please remove it or change category//

1 Like

Wow, I totally forgot that you can do this so easily with Discourse. Thanks!