# Discourse 在提及中显示全名

**URL:** https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319
**Category:** Theme component
**Created:** [2022年一月28日 14:51 UTC](https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319 "2022-01-28T14:51:12Z")
**Posts on this page:** 11
**Page:** 2

<div class="post-metadata">

### Author: ![thoka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thoka/32/115652_2.png) [@thoka](https://meta.discourse.org/u/thoka)
#### Post date: [2023年十月10日 22:09 UTC](https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319/24 "2023-10-10T22:09:04Z")

</div>

> [@Hifihedgehog](#):
>
> 我试过这个，而且它运行正常，没有产生任何严重影响。有没有办法在不使用插件的情况下，仅使用主题组件来整合群组？

使用组件：不行，这取决于插件。

但是，您应该能够重命名群组的句柄，因为在德语的 Discourse 中，群组 10 被命名为“vertrauensstufe\_0”，而不是“trust\_level\_0”。因此，您可能可以成功地将名称设置为“everybody”。

---

<div class="post-metadata">

### Author: ![Hifihedgehog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hifihedgehog/32/140207_2.png) [@Hifihedgehog](https://meta.discourse.org/u/Hifihedgehog)
#### Post date: [2023年十月11日 00:01 UTC](https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319/25 "2023-10-11T00:01:17Z")

</div>

这说得通。从开发者的角度来看，a.mention-group 包含什么，或者更确切地说，我如何查看 a.mention-group 的数据结构？我并非以 JavaScript 开发为生，但我足以通过反向工程来处理。我正在尝试修改 @saquetim 的扩展，以获取 a.mention-group 和 a.mention 的数据，并使用 Ajax 将它们融合在一起。

---

<div class="post-metadata">

### Author: ![saquetim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saquetim/32/116400_2.png) [@saquetim](https://meta.discourse.org/u/saquetim)
#### Post date: [2023年十月15日 02:44 UTC](https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319/26 "2023-10-15T02:44:41Z")

</div>

好的，这个周末我设法抽出时间来改进这个主题组件，并将其更新到了 2.0 版本。

**它现在效率更高了。**

该组件的 2.0 版本包含以下新功能：

- 优化了用户数据的加载，以尽可能减少 Ajax 请求次数，每次最多可获取 50 个用户/组。  
如果启用了站点设置 `enable user status`，它还可以利用序列化数据。在这种情况下，它将仅执行 Ajax 请求来获取组提及的数据。
- 添加了对显示组提及的全名的支持。
- 添加了用于自定义提及中名称渲染方式的设置。
- 添加了在引用时将渲染的提及文本还原回原始 Markdown 的支持。

新版本需要一个相当新的 Discourse 功能，所以你需要将 Discourse 更新到至少 3.2.0.beta2。

@Hifihedgehog，@thoka 如果你们想尝试一下。如果遇到任何问题，请告诉我。

---

<div class="post-metadata">

### Author: ![Hifihedgehog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hifihedgehog/32/140207_2.png) [@Hifihedgehog](https://meta.discourse.org/u/Hifihedgehog)
#### Post date: [2023年十月18日 13:44 UTC](https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319/29 "2023-10-18T13:44:00Z")

</div>

我有一个小问题。我可以在建议栏中看到用户提及的完整或显示名称，但在帖子中看不到。请看下面。我确实在建议栏和帖子中都看到了群组提及的完整或显示名称。也请看下面。所以总而言之，完整名称似乎在群组提及中普遍显示，但在用户提及中不显示，特别是仅在发布的帖子中显示。

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

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/e/1/ae116d1cc292ca3063d4a8f93bdedebb2c80b6ea.png)

---

<div class="post-metadata">

### Author: ![saquetim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saquetim/32/116400_2.png) [@saquetim](https://meta.discourse.org/u/saquetim)
#### Post date: [2023年十月18日 19:45 UTC](https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319/30 "2023-10-18T19:45:04Z")

</div>

这有点奇怪。

您最近更新过您的 Discourse 实例吗？它需要一个非常新的功能。

此外，控制台中是否有任何错误？

---

<div class="post-metadata">

### Author: ![Hifihedgehog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hifihedgehog/32/140207_2.png) [@Hifihedgehog](https://meta.discourse.org/u/Hifihedgehog)
#### Post date: [2023年十月18日 19:53 UTC](https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319/31 "2023-10-18T19:53:03Z")

</div>

是的，截至今天早上，我已更新到最新版本。我按照您的指示进行了更新，尽管我之前已是 3.2.0.beta2 版本。所以我现在是 3.2.0.beta3-dev 版本。Sidekiq 中没有我能看到的错误。

---

<div class="post-metadata">

### Author: ![saquetim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saquetim/32/116400_2.png) [@saquetim](https://meta.discourse.org/u/saquetim)
#### Post date: [2023年十月18日 20:03 UTC](https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319/32 "2023-10-18T20:03:29Z")

</div>

> [@Hifihedgehog](#):
>
> 我看不到 sidekiq 中有任何错误。

我的意思是，浏览器控制台。抱歉。

你能打开浏览器的开发者工具并检查是否有任何错误吗？

---

<div class="post-metadata">

### Author: ![Hifihedgehog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hifihedgehog/32/140207_2.png) [@Hifihedgehog](https://meta.discourse.org/u/Hifihedgehog)
#### Post date: [2023年十月18日 20:17 UTC](https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319/33 "2023-10-18T20:17:51Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/4X/3/8/d/38d249e972db5d93caea4e5a9ea782fdcb39512e.jpeg)

---

<div class="post-metadata">

### Author: ![saquetim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saquetim/32/116400_2.png) [@saquetim](https://meta.discourse.org/u/saquetim)
#### Post date: [2023年十月18日 21:00 UTC](https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319/34 "2023-10-18T21:00:44Z")

</div>

@Hifihedgehog，处理非全小写用户名的 bug 已经修复。请稍后更新组件并重试。

---

<div class="post-metadata">

### Author: ![Hifihedgehog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hifihedgehog/32/140207_2.png) [@Hifihedgehog](https://meta.discourse.org/u/Hifihedgehog)
#### Post date: [2023年十月19日 02:45 UTC](https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319/35 "2023-10-19T02:45:15Z")

</div>

是的，我这边一切正常！感谢您快速的响应！😃

---

<div class="post-metadata">

### Author: ![thoka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thoka/32/115652_2.png) [@thoka](https://meta.discourse.org/u/thoka)
#### Post date: [2025年十一月16日 15:12 UTC](https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319/36 "2025-11-16T15:12:10Z")

</div>

我们利用群组句柄来透明地运作，同时确保只通知相关收件人。目前，我们必须教育用户选择正确的句柄来称呼个人，因为在复制和粘贴操作期间会显示更改后的句柄。

您能否考虑一种方法，如何通过复制和粘贴来传输正确的提及，特别是与[新编辑器](https://meta.discourse.org/t/introducing-our-new-composer-making-writing-on-discourse-easier-than-ever/369779)结合使用？

[上一頁](https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319.md?page=1)
