For one on my forum, I got rid of this message simply by moving my JS script to the new JS customization tab.
On my other forum, it doesn’t work that easily.
It’s an old override that shows the composer’s tag field only in categories that accept tags:
This script was heavily based on a similar (and old, 2019 or older) modification posted on meta, but I can’t find the original post anymore.
Anyway, there are two questions in one:
How to properly move this in the JS tab? Is it possible, or should I create a theme component?
Is there a more elegant way to hide/show the composer’s tag selector only in certain categories? I use tags for only 1 category on my forum (an ads category with #search and #offer tags)
It doesn’t solve it for staff [1], but if you set the tags as restricted to that category, they won’t be usable (by non-staff) on other categories. From a category /edit/tags:
Tags and tag groups specified above will only be available in this category and other categories that also specify them. They won’t be available for use in other categories.
I had a look at how it works, since it has been a long time.
Tag inputs appear on the composer when creating a new topic regardless of the selected category (even if the category has no available tags for others than admins), which is I want to prevent
CSS only won’t work, because the composer can be open on any page, and there’s no parent CSS targetting the wanted category that would help hiding the composer’s tag input, which I believe is why I used javascript for.
So, unless I’m missing something I still need a script to achieve my goal.
It should be possible to just copy/paste it. Stuff in the JS tab is run in exactly the same way as <script type='text/discourse-plugin>. If it’s not working, can you share the code?