# 分类特定消息或置顶主题

**URL:** https://meta.discourse.org/t/category-specific-message-or-pinned-topic/140473
**Category:** Support
**Created:** [2020年二月3日 15:12 UTC](https://meta.discourse.org/t/category-specific-message-or-pinned-topic/140473 "2020-02-03T15:12:08Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![chrismalone](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrismalone/32/506946_2.png) [@chrismalone](https://meta.discourse.org/u/chrismalone)
#### Post date: [2020年二月3日 15:12 UTC](https://meta.discourse.org/t/category-specific-message-or-pinned-topic/140473/1 "2020-02-03T15:12:08Z")

</div>

我们正在寻找一种方法，使某类别的消息不仅显示在该类别的“首页”上，还能显示在该类别下所有主题的顶部。目前是否有实现这一功能的方法？我们已经创建了一些置顶主题，但显然，这些主题仅显示在类别首页上。

---

<div class="post-metadata">

### Author: ![Thomas\_G](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_g/32/200158_2.png) [@Thomas\_G](https://meta.discourse.org/u/Thomas_G)
#### Post date: [2020年二月3日 15:19 UTC](https://meta.discourse.org/t/category-specific-message-or-pinned-topic/140473/2 "2020-02-03T15:19:42Z")

</div>

> [@chrismalone](#):
>
> 在该分类下所有帖子的顶部

不太清楚这里的问题是什么，能否请您详细说明一下？当您“置顶分类帖子”时，该帖子会显示在该分类下所有帖子的顶部。

---

<div class="post-metadata">

### Author: ![lucasbasquerotto](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lucasbasquerotto/32/133376_2.png) [@lucasbasquerotto](https://meta.discourse.org/u/lucasbasquerotto)
#### Post date: [2020年二月3日 18:21 UTC](https://meta.discourse.org/t/category-specific-message-or-pinned-topic/140473/3 "2020-02-03T18:21:48Z")

</div>

> [@Thomas\_G](#):
>
> 当你将某个主题_分类置顶_时，它会出现在该分类下所有主题的顶部。

我想他的意思是，在该分类下的每个主题页面顶部（即主题页面 `/t/.../[topic_id]` 的顶部，而不仅仅是在分类页面 `/c/.../[category_id]` 上），如果我没理解错的话。

---

<div class="post-metadata">

### Author: ![JimPas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimpas/32/148179_2.png) [@JimPas](https://meta.discourse.org/u/JimPas)
#### Post date: [2020年二月4日 02:38 UTC](https://meta.discourse.org/t/category-specific-message-or-pinned-topic/140473/4 "2020-02-04T02:38:33Z")

</div>

就像在每个特定类别的主题顶部固定的_ **横幅** _一样。😉

---

<div class="post-metadata">

### Author: ![ked](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ked/32/64837_2.png) [@ked](https://meta.discourse.org/u/ked)
#### Post date: [2020年二月4日 04:00 UTC](https://meta.discourse.org/t/category-specific-message-or-pinned-topic/140473/5 "2020-02-04T04:00:28Z")

</div>

我同样渴望实现这一点。本质上，就是能够向所有在特定类别中交易的人传达一条信息。

---

<div class="post-metadata">

### Author: ![chrismalone](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrismalone/32/506946_2.png) [@chrismalone](https://meta.discourse.org/u/chrismalone)
#### Post date: [2020年二月6日 09:36 UTC](https://meta.discourse.org/t/category-specific-message-or-pinned-topic/140473/7 "2020-02-06T09:36:20Z")

</div>

是的，这正是我想要实现的目标：特定分类或子分类下的每个主题页面。

@JimPas - 据你所知，现在这是否可行？

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2020年二月19日 14:26 UTC](https://meta.discourse.org/t/category-specific-message-or-pinned-topic/140473/8 "2020-02-19T14:26:08Z")

</div>

你可以通过自定义主题组件来实现这一点。Discourse 本身没有内置的方法可以做到这一点。

---

<div class="post-metadata">

### Author: ![chrismalone](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrismalone/32/506946_2.png) [@chrismalone](https://meta.discourse.org/u/chrismalone)
#### Post date: [2020年二月20日 08:55 UTC](https://meta.discourse.org/t/category-specific-message-or-pinned-topic/140473/9 "2020-02-20T08:55:30Z")

</div>

谢谢 @eviltrout！有什么例子可以推荐给我吗？如果没有，我就自己摸索一下，看看能不能弄明白。非常感谢您的建议！！

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2020年二月20日 14:49 UTC](https://meta.discourse.org/t/category-specific-message-or-pinned-topic/140473/10 "2020-02-20T14:49:11Z")

</div>

我不熟悉该插件的代码，但我知道这个插件做了许多类似的自定义：

> [@Topic List Previews (legacy)](https://meta.discourse.org/t/topic-list-previews/101646):
>
> This is now a Theme Component, the plugin is deprecated The new Topic is [Topic List Previews Theme Component - theme - Discourse Meta](https://meta.discourse.org/t/topic-list-previews-theme-component/209973/1) [GitHub-Mark-32px] [Repository: get the code here](https://github.com/merefield/discourse-topic-list-previews-theme) See further here: [Pavilion](https://thepavilion.io/t/which-one-to-install-plugin-or-tc/3996?u=merefield) [sandbox] Examples: check out the list further down. [raising_hand_woman Request a feature](https://thepavilion.io/w/feature-request)[bug Report a bug](https://thepavilion.io/w/bug-report)heart Donate: we are reviewing our donations system. Please check back later :). man_technologist Maintainers: @merefieldOverview Topic List Previews allows you to: …

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [2020年二月20日 15:12 UTC](https://meta.discourse.org/t/category-specific-message-or-pinned-topic/140473/11 "2020-02-20T15:12:47Z")

</div>

制作一个原型会很有帮助。

“主题列表预览”功能可以在分类顶部展示一系列图片，并附带称为“特色图片”的相关文本摘要。您只需标记希望在此处突出的主题即可。当用户将鼠标悬停在图片上时，会看到该主题的摘要文本。如果主题本身没有图片，此功能可能不太实用。这主要是一个以图片为中心的插件，因此可能满足需求，也可能不够。一个变通方法是添加一张您希望使用的默认图片。

---

<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: [2024年一月24日 00:06 UTC](https://meta.discourse.org/t/category-specific-message-or-pinned-topic/140473/12 "2024-01-24T00:06:47Z")

</div>



---

<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年一月24日 09:07 UTC](https://meta.discourse.org/t/category-specific-message-or-pinned-topic/140473/13 "2024-01-24T09:07:57Z")

</div>


