# 增加将“新主题”按钮路由到自定义 URL 的功能

**URL:** https://meta.discourse.org/t/add-ability-to-route-the-new-topic-button-to-a-custom-url/369638
**Category:** Feature
**Tags:** topic-button-text
**Created:** [2025年六月10日 22:52 UTC](https://meta.discourse.org/t/add-ability-to-route-the-new-topic-button-to-a-custom-url/369638 "2025-06-10T22:52:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [2025年六月10日 22:52 UTC](https://meta.discourse.org/t/add-ability-to-route-the-new-topic-button-to-a-custom-url/369638/1 "2025-06-10T22:52:38Z")

</div>

我真的很喜欢 [Customize new topic button text](https://meta.discourse.org/t/customize-new-topic-button-text/269086) 主题组件，但我需要它路由到 [Custom Wizard Plugin 🧙](https://meta.discourse.org/t/custom-wizard-plugin/73345) 的向导。

我可以使用插件的原生功能来实现路由，但当我尝试使用此 TC 来更改文本和图标时，我会失去它。这是因为 TC 隐藏了“OG”按钮并用新按钮替换了它。

我建议在 TC 中添加一个新设置，允许添加自定义 URL，如果存在，则将替换按钮指向所需位置。这是相关的 PR：

> <https://github.com/discourse/discourse-customize-new-topic-button-text/pull/42>
>
> Adds the ability to specify a custom URL for the New Topic button.
> 
> The classi…c use case is redirecting to a Custom Wizard for topic generation, but there are other situations in which this would be very helpful.
> 
> If blank, falls back to the standard behaviour.
> 
> See https://meta.discourse.org/t/add-ability-to-route-the-new-topic-button-to-a-custom-url/369638 for more info

我现在在我们的网站上使用它，它似乎运行良好：

![Screenshot 2025-06-11 10.45.10](https://global.discourse-cdn.com/meta/original/4X/3/e/2/3e2092c326d263d1816cc43c1782b6985d0656c9.png)

点击后，它会带您到我们的活动主题创建向导：

 ![The image displays a form for event details for eHEALTH FORUM, organized by HINZ, including fields for the event title, location, and start date. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/8/f/7/8f744804941df481446586d096cc08db78555f28.png)
