# 使用新的自定义主页功能

**URL:** <https://meta.discourse.org/t/using-the-new-custom-homepage-feature/302496>\
**Category:** Development\
**Created:** [2024年四月4日 21:43 UTC](https://meta.discourse.org/t/using-the-new-custom-homepage-feature/302496 "2024-04-04T21:43:02Z")\
**Posts on this page:** 1\
**Showing post:** 49

<div class="post-metadata">

**Author:** ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)\
**Post date:** [2025年九月3日 16:30 UTC](https://meta.discourse.org/t/using-the-new-custom-homepage-feature/302496/49 "2025-09-03T16:30:08Z")

</div>

{“content”:“[quote="OsaIsacson, post:48, topic:302496"]\n`` 我只是在代码中我想要的地方添加了 {{whos-online}} 和 {{search-menu}}，但这在这里不起作用——我找不到正确注入它们的方法。\n[/quote]\n\n我本地快速查看了一下，遇到了 `WhosOnline` 组件的问题。但在重启服务器后，它运行正常。我在主页组件中使用的代码是：\n\n`\nimport WhosOnline from \"discourse/plugins/discourse-whos-online/discourse/components/whos-online\";\n\n\n...\n\n\u003ctemplate\u003e\n \u003cWhosOnline /\u003e\n\u003c/template\u003e\n`\n\n但请记住，`SearchMenu` 始终存在，因为它在核心代码中，而 `\u003cWhosOnline /\u003e` 来自一个插件，并且仅在插件启用时才注册。”,“target\_locale”:“zh\_CN”}

---

_[View the full topic](https://meta.discourse.org/t/using-the-new-custom-homepage-feature/302496)._
