# 编辑特定分类的“新主题”？

**URL:** https://meta.discourse.org/t/edit-new-topic-for-a-specific-category/263820
**Category:** Support
**Created:** [2023年五月4日 13:04 UTC](https://meta.discourse.org/t/edit-new-topic-for-a-specific-category/263820 "2023-05-04T13:04:10Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![carbonrich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/carbonrich/32/274219_2.png) [@carbonrich](https://meta.discourse.org/u/carbonrich)
#### Post date: [2023年五月4日 13:04 UTC](https://meta.discourse.org/t/edit-new-topic-for-a-specific-category/263820/1 "2023-05-04T13:04:11Z")

</div>

我相信很多人都有类似的情况。

我们有一个“请求”类别，用户可以在其中向社区请求资源，其中包含一个模板回复，以帮助他们提出清晰有用的请求。

在用户测试中，我们发现用户对这个类别有点困惑，提出的解决方案之一是将“新建主题”更改为“新建请求”，以帮助用户理解该操作。

这可能吗？

我在 Meta 中找到的唯一帖子是关于全局更改“新建主题”（js.topic.create）的，而不是针对特定类别的……

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [2023年五月14日 20:53 UTC](https://meta.discourse.org/t/edit-new-topic-for-a-specific-category/263820/2 "2023-05-14T20:53:13Z")

</div>

你好，

目前你可以通过这种方式实现，但我正在考虑创建一个具有一些设置的易于更改的主题组件。🤔 让我们拭目以待 🙂

> [@Create a new topic button with category and topic template](https://meta.discourse.org/t/create-a-new-topic-button-with-category-and-topic-template/85775/23?u=dodesz):
>
> This stopped working. A new way to rename the button depending on the category is posted here: How to: Clone or download and unzip theme component from [GitHub - VaperinaDEV/category-btn-name](https://github.com/VaperinaDEV/category-btn-name) Edit file category-btn-name/locales/en.yml and enter the various button texts you want to use, e.g. en: new\_event: New Event new\_deadline: New Deadline Edit file category-btn-name/javascripts/discourse/api-initializers/initialize-btn-names.js to define which button text to use for what categories: …

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [2023年五月15日 02:12 UTC](https://meta.discourse.org/t/edit-new-topic-for-a-specific-category/263820/3 "2023-05-15T02:12:00Z")

</div>

@carbonrich - here is some simple CSS code fun for you if you want to try. you will need to change the CATEGORY\_PLUG to the appropriate category plug for the one you want the button to be used in.

common css

```scss
.category-[CATEGORY_PLUG]{
    #create-topic.btn-default.btn.btn-icon-text {
        width: 160px;
           span.d-button-label {
            position: relative;
            visibility: hidden;
           }
           span.d-button-label:after {
            content: "New Request";   
            position: absolute;
            visibility: visible;
            left: 0px;
            top: 0px;
           }
    }   
}

```

---

<div class="post-metadata">

### Author: ![carbonrich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/carbonrich/32/274219_2.png) [@carbonrich](https://meta.discourse.org/u/carbonrich)
#### Post date: [2023年五月16日 09:51 UTC](https://meta.discourse.org/t/edit-new-topic-for-a-specific-category/263820/4 "2023-05-16T09:51:42Z")

</div>

感谢 @Don，不知道我怎么错过了这个，一个主题组件会很棒，如果能有所帮助，我很乐意为它的实现贡献一点经济上的支持。

另外感谢 @Lilly，这在技术上肯定可行，但我认为它不符合无障碍性/WCAG 标准，例如，请参阅：

> **[Writing CSS with Accessibility in Mind](https://medium.com/@matuzo/writing-css-with-accessibility-in-mind-8514a0007939#7013)**
>
> An introduction to web accessibility. Tips on how to improve the accessibility of your web sites and apps with CSS.

不过，我对这方面的了解可能有点过时了，如果说错了，我很乐意被纠正。

---

<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: [2023年六月21日 14:48 UTC](https://meta.discourse.org/t/edit-new-topic-for-a-specific-category/263820/7 "2023-06-21T14:48:37Z")

</div>

我构建了一个主题组件，可以根据类别或标签更改此文本：

> [@Customize new topic button text](https://meta.discourse.org/t/customize-new-topic-button-text-based-on-category-or-tag/269086):
>
> discourse2Summary Customize the new topic button per category or tageyeglassesPreview [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/customize-new-topic-button)hammer_and_wrenchRepository [https://github.com/discourse/discourse-customize-new-topic-button-text](https://github.com/discourse/discourse-customize-new-topic-button-text)questionInstall Guide [How to install a theme or theme component](https://meta.discourse.org/t/how-do-i-install-a-theme-or-theme-component/63682)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component Features This theme component allows you to customize the New Topic…

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2024年六月8日 12:36 UTC](https://meta.discourse.org/t/edit-new-topic-for-a-specific-category/263820/8 "2024-06-08T12:36:44Z")

</div>

此主题已自动关闭 400 天。不再允许回复。
