# 如何仅对特定类别启用反应？

**URL:** https://meta.discourse.org/t/how-to-enable-reactions-only-for-certain-categories/267029
**Category:** Development
**Tags:** reactions
**Created:** [2023年六月2日 08:08 UTC](https://meta.discourse.org/t/how-to-enable-reactions-only-for-certain-categories/267029 "2023-06-02T08:08:14Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [2023年六月2日 15:38 UTC](https://meta.discourse.org/t/how-to-enable-reactions-only-for-certain-categories/267029/2 "2023-06-02T15:38:57Z")

</div>

没有这样的功能。一种快速实现的方法是使用 CSS 隐藏反应选择器，例如：

```css
.category-general-resources .discourse-reactions-picker {
    display: none;
}

```

如果你想遍历多个类别并使其更易于维护，可以使用类似以下的 SCSS 循环：

```scss
$categories: 'general', 'site-feedback', 'staff';

@each $category in $categories {
  .category-#{$category} .discourse-reactions-picker {
    display: none;
  }
}

```

类别类在 `<body>` 标签中可见。

任何知道如何从客户端再次显示它的用户都可以绕过它，但如果你的社区行为良好，我认为这是一个很好的解决方法。 🙂

---

_[View the full topic](https://meta.discourse.org/t/how-to-enable-reactions-only-for-certain-categories/267029)._
