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?
I personally would rather it not apply globally, the point of Admins is supposed to be you can override anything and this would make it impossible to override this specific thing. Unless you add a way to get around that, which just seems like a lot more work than leaving it as is.
I mean Admins can post in closed topics just like they’re normal topics, and that’s obviously intended. It’s completely normal behavior for them not to be constrained by anything they put on the site IMO