# 从内联提及中移除父类别

**URL:** <https://meta.discourse.org/t/remove-parent-category-from-inline-category-mentions/413795>\
**Category:** Theme component\
**Tags:** mentions\
**Created:** [2026 年10 月 2 日 13:57 UTC](https://meta.discourse.org/t/remove-parent-category-from-inline-category-mentions/413795 "2026-10-02T13:57:46Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

作者： ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)\
发布日期： [2026 年10 月 2 日 17:00 UTC](https://meta.discourse.org/t/remove-parent-category-from-inline-category-mentions/413795/5 "2026-10-02T17:00:50Z")

</div>

> [@putty](#):
>
> 再次感谢提醒关于 observer 的事情。我之前不知道它不被推荐。

哦，谢谢你的考虑！说实话，当我开始尝试在 Discourse 中编写代码时，我就已经意识到了这一点，后来 Sam 也确认了。

幸运的是，几乎总是有不同的方法可以选用，因此插件和主题组件能够符合建议的最佳实践，并且易于维护。

我会使用你的 TC，因为我真的希望这个新功能能按预期正常工作 👌

---

_[View the full topic](https://meta.discourse.org/t/remove-parent-category-from-inline-category-mentions/413795)._
