# 注册横幅

**URL:** https://meta.discourse.org/t/signup-banner/210745
**Category:** Theme component
**Tags:** official, signup-banner
**Created:** [2021年十二月1日 18:55 UTC](https://meta.discourse.org/t/signup-banner/210745 "2021-12-01T18:55:15Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [2021年十二月1日 18:55 UTC](https://meta.discourse.org/t/signup-banner/210745/1 "2021-12-01T18:55:15Z")

</div>

| | | |
| --- | --- | --- |
| :discourse2: | **摘要** | **Signup Banner** 连接到核心注册 CTA，并将显示弹出式横幅（除了主题末尾的正常 CTA 区块之外）。 |
| 👓 | **预览** | [在 Discourse Theme Creator 上预览](https://discourse.theme-creator.io/theme/Discourse/signup-banner)   
(需要匿名窗口并满足以下条件) |
| 🛠 | **仓库链接** | [https://github.com/discourse/discourse-signup-banner](https://github.com/discourse/discourse-signup-banner) |
| 📖 | **初次使用 Discourse 主题？** | [使用 Discourse 主题的初学者指南](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) |

安装此主题组件

> [@](#):
>
> :discourse2: 由于这是由 Discourse 团队维护的 #official 主题组件，#support、#contribute:bug、#Contribute > UX 和 #Contribute > Feature 请求可以在 Meta 上的相应类别中提出，并标记适当的主题组件标签。点击下面的链接开始一个新话题。 👍
> 
> [❓&nbsp; **支持**](https://meta.discourse.org/new-topic?category_id=6&tags=signup-banner "请求关于配置和使用 Signup Banner 的支持") [🐛&nbsp; **Bug**](https://meta.discourse.org/new-topic?category_id=1&tags=signup-banner "Bug 报告意味着某处出现问题，阻止了主题组件的正常/典型使用") [👀&nbsp; **UX**](https://meta.discourse.org/new-topic?category_id=9&tags=signup-banner "关于 Signup Banner 的用户界面讨论，以及功能如何呈现（包括语言和 UI 元素）") [💡&nbsp; **功能**](https://meta.discourse.org/new-topic?category_id=2&tags=signup-banner "关于如何改进或增强现有 Signup Banner 功能，以及提议的新功能如何工作的讨论")

### 功能

显示此横幅以及主题底部内置的注册 CTA 需要满足以下条件。

这些条件是：

- 用户是匿名的
- 用户已阅读至少两个主题
- 用户已阅读至少两分钟

主题列表页面

 ![主题列表页面](https://global.discourse-cdn.com/meta/original/3X/7/6/767ff3b86b59cc09b54bdffeccd145747d87fbcf.png)

主题页面

 ![主题页面](https://global.discourse-cdn.com/meta/original/3X/6/c/6c233eed24a5ed8a4d8612cc28057187c384e561.png)

### 设置

| 名称 | 描述 |
| --- | --- |
| 标题文本 | 加入对话，立即注册！ |
| 副标题文本 | 创建账户后，我们将记住您阅读过的所有内容，这样您总能回到之前阅读的位置。 |
| 注册文本 | 注册 |
| 稍后提醒文本 | 稍后再说 |
| 关闭文本 | 不再显示 |

  

> :discourse2: **由我们托管？** 主题组件在我们的 Pro、Business 和 Enterprise 计划中均可使用。

---

<div class="post-metadata">

### Author: ![hequaye](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hequaye/32/241683_2.png) [@hequaye](https://meta.discourse.org/u/hequaye)
#### Post date: [2021年十二月1日 18:57 UTC](https://meta.discourse.org/t/signup-banner/210745/2 "2021-12-01T18:57:24Z")

</div>

> [@jordan-vidrine](#):
>
> 此组件将连接到核心注册CTA，并将显示一个弹出横幅（除了主题末尾的正常CTA块之外）。

哥们，你简直是读懂了我的心思！！！我正在为我正在参与的一个社区做公开发布准备，这正是我所需要的！

---

<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: [2021年十二月1日 18:58 UTC](https://meta.discourse.org/t/signup-banner/210745/3 "2021-12-01T18:58:46Z")

</div>

谢谢！

我们正在使用 Memberful 进行注册——它仍然有效吗？

---

<div class="post-metadata">

### Author: ![jordan.vidrine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jordan.vidrine/32/515563_2.png) [@jordan.vidrine](https://meta.discourse.org/u/jordan.vidrine)
#### Post date: [2021年十二月1日 18:59 UTC](https://meta.discourse.org/t/signup-banner/210745/4 "2021-12-01T18:59:41Z")

</div>

注册按钮会将用户转到 Discourse 的 `sign-up` 路由。它_应该_与用户点击 Discourse 网站顶部的常规 `sign up` 按钮的行为相同。

---

<div class="post-metadata">

### Author: ![Sherran](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sherran/32/267631_2.png) [@Sherran](https://meta.discourse.org/u/Sherran)
#### Post date: [2022年八月15日 03:43 UTC](https://meta.discourse.org/t/signup-banner/210745/5 "2022-08-15T03:43:05Z")

</div>

有什么方法可以预览该组件吗？我已经安装并生效了，但是无法在我的隐身页面上看到此横幅。

---

<div class="post-metadata">

### Author: ![Rhod](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rhod/32/507923_2.png) [@Rhod](https://meta.discourse.org/u/Rhod)
#### Post date: [2022年八月18日 22:24 UTC](https://meta.discourse.org/t/signup-banner/210745/6 "2022-08-18T22:24:38Z")

</div>

同样的问题，在“阅读”2分钟后，我无法看到它，并且通过隐身浏览器“匿名”。

---

<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: [2022年八月19日 09:10 UTC](https://meta.discourse.org/t/signup-banner/210745/7 "2022-08-19T09:10:25Z")

</div>

您好，它会连接到核心注册号召性用语横幅，并与底部出现的号召性用语同时显示。

这是核心注册号召性用语：🔽

 ![Screenshot 2022-08-19 at 11.04.38](https://global.discourse-cdn.com/meta/original/4X/c/3/e/c3e4ea81fd57938e513205e55ae1fe950871ea46.png)

为此，您需要：🔽

> [@jordan-vidrine](#):
>
> 标准是：
> 
> - 用户是匿名的
> - 用户至少阅读了两个主题
> - 用户至少阅读了两分钟

而且我认为，如果禁用了 `enable signup cta` 站点设置，它将不会显示。  
 ![Screenshot 2022-08-19 at 10.47.23](https://global.discourse-cdn.com/meta/original/4X/3/2/1/321ca36a8557b63a1cf16b509ae2ec26e88fb518.png)

---

<div class="post-metadata">

### Author: ![Danny\_Dainton](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danny_dainton/32/486326_2.png) [@Danny\_Dainton](https://meta.discourse.org/u/Danny_Dainton)
#### Post date: [2025年二月6日 13:04 UTC](https://meta.discourse.org/t/signup-banner/210745/8 "2025-02-06T13:04:17Z")

</div>

有人在使用此组件的网站上更改过它的样式或位置吗？

我很想听听或看看你们都做了些什么 🙏

我遇到了一个情况，横幅显示出来了，但标题导航栏中的登录按钮也显示出来了 😬

 ![image](https://global.discourse-cdn.com/meta/original/4X/f/8/6/f860ada9f22abc2577976e8d170a7b7500ea1c0c.png)

如果横幅类显示出来了，我是否可以使用 CSS 在主题中隐藏它？我尝试过类似这样的方法，但没有帮助 ☹

```plaintext
.discourse-signup-banner:not([style*="display: none"]) .auth-buttons {
    display: none !important;
}

```

* * *

_编辑_

我通过这样做实现了这个目标 ❤

```plaintext
body:has(.discourse-signup-banner) .auth-buttons {
    display: none !important;
}

```

---

<div class="post-metadata">

### Author: ![Danny\_Dainton](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danny_dainton/32/486326_2.png) [@Danny\_Dainton](https://meta.discourse.org/u/Danny_Dainton)
#### Post date: [2025年五月23日 10:17 UTC](https://meta.discourse.org/t/signup-banner/210745/9 "2025-05-23T10:17:58Z")

</div>

各位，

有人遇到过“稍后”或“忽略”按钮不起作用的问题吗？注册号召性用语似乎没问题，但其他按钮却毫无反应。

我在控制台中没有看到任何错误表明有什么东西坏了 🤔

有什么帮助都将是极好的 🙏

---

<div class="post-metadata">

### Author: ![jahan\_gagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jahan_gagan/32/501948_2.png) [@jahan\_gagan](https://meta.discourse.org/u/jahan_gagan)
#### Post date: [2025年八月6日 10:35 UTC](https://meta.discourse.org/t/signup-banner/210745/10 "2025-08-06T10:35:33Z")

</div>

嘿！👋

我已提交一个 PR 来修复“稍后”/“忽略”按钮无法正常工作的问题。您可以在此处查看：

> <https://github.com/discourse/discourse-signup-banner/pull/41>
>
> Previously, \`@action="showBannerLater"\` and similar strings were used for button… actions, which don’t work correctly in Ember Octane-style components. As a result, the actions weren’t invoked.
> 
> This PR switches to using \`@action={{this.showBannerLater}}\` and \`@action={{this.dismissBanner}}\` to properly bind to the class methods.
> 
> Tested locally with anonymous users — the banner actions now work as expected.

希望这有帮助！🙌
