# 自定义文本：+ 新建主题

**URL:** https://meta.discourse.org/t/customize-text-new-topic/140593
**Category:** Support
**Created:** [2020年二月4日 14:44 UTC](https://meta.discourse.org/t/customize-text-new-topic/140593 "2020-02-04T14:44:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![outofthebox](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/outofthebox/32/83708_2.png) [@outofthebox](https://meta.discourse.org/u/outofthebox)
#### Post date: [2020年二月4日 14:44 UTC](https://meta.discourse.org/t/customize-text-new-topic/140593/1 "2020-02-04T14:44:26Z")

</div>

您好，

是否可以按类别自定义“+ 新建主题”的文本？

例如，在一个类别中，我们可能希望显示“自我介绍”，在另一个类别中显示“提问”，在另一个类别中显示“分享您的故事”等。

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2020年二月4日 16:23 UTC](https://meta.discourse.org/t/customize-text-new-topic/140593/2 "2020-02-04T16:23:35Z")

</div>

开箱即用不可行，但我认为在主题组件中可以实现……你可能需要在 `d-navigation.hbs` 或 `create-topic-button.hbs` 模板中添加一些条件判断。

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2020年二月10日 14:53 UTC](https://meta.discourse.org/t/customize-text-new-topic/140593/3 "2020-02-10T14:53:42Z")

</div>

本主题组件（由 @outofthebox 慷慨赞助）将使用 jQuery 覆盖新主题按钮的文本。我选择使用 jQuery 而不是按照上述建议修改模板，因为这样更易于维护（至少根据我的经验如此）。

> **[GitHub - communiteq/discourse-tc-override-newtopic-text](https://github.com/communiteq/discourse-tc-override-newtopic-text)**
>
> Contribute to communiteq/discourse-tc-override-newtopic-text development by creating an account on GitHub.

该主题组件提供设置，可按主题分类标识符（slug）覆盖按钮文本。  
对于子分类，请使用 `主分类标识符-子分类标识符` 格式。

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/2/d21854e34bdcf842bb80fa9f994aa6cf8c4cff6c.png)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2020年三月11日 15:01 UTC](https://meta.discourse.org/t/customize-text-new-topic/140593/4 "2020-03-11T15:01:28Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
