Install this theme component
This theme component allows you to customize the New Topic button on a category or tag topic list, as well as the action name and button in the composer (highlighted below). If you have a bug category for example, you can update this text to say “Report bug.”
There are two settings, the primary being
custom new topic text:
This setting allows you to set the filter (tag or category name), the icon for the “New Topic” button (this doesn’t change the icons in the composer), as well as the action name at the top of the composer, and the composer’s “Create Topic” button.
There’s an additional setting, enabled by default, called
inherit parent category. When this is enabled all child categories will also have their text changed (unless otherwise specified in the settings).
Note that if you setup a tag it will override the selected category.
Ideas for future enhancement:
- localizable text for different languages
- support for category and tag combinations, and multiple tags
Tha’ts really good, Thanks alot <3
Today, I was working on a much simpler version of this using
This is a so much better solution. Thank you @awesomerobot!
In my experiments, I was never able to override the Composer button label for the categories using the discourse-post-voting plugin. This becomes a bigger issue when multiple categories are enabled for post voting.
If I may suggest; enabling support for overriding
discourse-post-voting labels, would be a great enhancement. ( :
This is a great theme component! An idea to take it a step further could be this:
If you are renaming the button because you effectively want to change what the type of topic is, then you should change the naming throughout the entire *category.
You have a category called
Events. You would effectively change the word “topic” in the entire category to “events”. It’s not “New Topic” its “New Event”, instead of a Topics list you’d have an Events list, etc.
You see this in other tools where you change the primary use case of something. Here is what AirTable does when you create a new table. Tables, by default, have “records”.
But let’s say I want to create a table called “Users”, then I can change each record to be called Users:
Treating the theme component this way would allow us to easily, effectively rebrand a category as a more specific entity. Support Requests, Events, etc.
I found this theme component when searching, because I wanted to change this word for “Topic” to “Events”:
@awesomerobot this theme component is seriously incredible, thank you so much for it!
I’m noticing that this theme component seems to cause some odd behavior with the css for the New Topic button.
Theme component disabled:
Theme component enabled:
I’ve also noticed that while it changes the “Create Topic” button in the composer, which is awesome…
It also changes the Reply button text to that same string, which is less than ideal because it’s not creating another bug report, it’s a reply
What are the chances another field could be added to the editor to change the reply button text (or leave it blank to leave it as
Sorry, one last thing: this also does not seem to respect the case where two subcategories (each of a different parent) have the same slug. e.g.:
In this case, I cannot get the theme component to differentiate between the two subcategories, and they both share the same configuration from the editor.
Thanks for the feedback, I’ve made some updates! FIX: action, switch category to ID, ignore replies by awesomerobot · Pull Request #5 · discourse/discourse-customize-new-topic-button-text · GitHub
I completely overlooked the reply button! For now I’ve just kept it as
reply, but a separate setting to change its text would make sense.
Good point, it seems like utilizing the category ID rather than the category name in the settings would be the best way to avoid this. So this means any existing settings you have in place will need to be updated.