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 these texts to say “Report Bug”:
(Some icons may need to be added to your
svg icon subset admin setting)
You can also customize the reply button text, this will replace the
reply text in the composer and within topics:
|custom new topic text
|This is where you enter the details for each customized button
|inherit parent category
|When disabled, subcategories will not automatically inherit the parent category text
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 set up a tag it will override the selected category.
Ideas for future enhancements
- Localizable text for different languages
- Support for category and tag combinations, and multiple tags
Hosted by us? Theme components are available to use on our Standard, Business, and Enterprise plans.
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.
It seems there’s a new bug. When this plugin is enabled, it creates two topic buttons:
Yes, thanks for reporting it, some connectors changed in Discourse — should be fixed now if you update:
Is it possible to fix the button size difference? (old screenshot, your newest update fixed the double-button issue)
Yes, this button should be the correct height now
Hmm strange, I tested it on the latest Discourse and everything’s working fine — I’ve just merged an update to the component that will solve that deprecation issue, can you update and try again?
Same here, its not showing up after multiple trys.
Unfortunately, this wonderful theme component does not seem to work along nicely with Custom Wizard Plugin 🧙
The Wizard plugin is able to hook to the category button via Category settings:
When using your Component, the button changes it’s name, but pressing it no longer launches Wizard selected in the category settings. We would be glad to use your component in big production website, but unable now. Hope it could be fixed. No pressure
I’m not seeing this, I have the same setup and my buttons work. You may need to look at other plugins or TC’s. I’m on the latest builds FYI.
This is a nice little component that can add some nice attention-to-detail polish to a site.
I think I have a bug.
The text of the “New Topic” button can no longer be modified.
The modification is effective for the other buttons.
Thank you for your help (and for these functions!)
Thanks for the report!
It looks like there is a regression from the latest PR:
It converts from the
@<param> syntax; however, the former is required since we are inside a plugin outlet.
EDIT: I made a PR
Thanks for the PR @Arkshine! this should be fixed on update
This will also be included on update: FEATURE: add ability to customize "Reply" text by 3-w-c · Pull Request #7 · discourse/discourse-customize-new-topic-button-text · GitHub
So now the option to also customize the reply button text in the composer and on posts (still based on tag and category) will be included.