I want to enforce a rule in my Discourse forum where, for a specific category only, users must attach a particular tag when creating a topic. Users can attach any number of tags, but one specific tag must be present; otherwise, the topic creation should be blocked with an error message.
I’m using the Blackout theme (or custom theme), and I want to add this validation client-side with JavaScript.
Is there a way to add such a condition in the theme’s JavaScript (e.g., in the Blackout theme’s custom code) to:
Check if the topic being created belongs to the specific category,
Check if the required tag is attached,
Show an error and prevent topic creation if the required tag is missing?
If yes, could someone please share an example or the best approach to do this?