# 在另一个网站上通过 iframe 嵌入整个 Discourse 论坛

**URL:** https://meta.discourse.org/t/embedding-a-whole-discourse-forum-on-another-site-in-an-iframe/157631
**Category:** Support
**Created:** [2020年七月13日 19:11 UTC](https://meta.discourse.org/t/embedding-a-whole-discourse-forum-on-another-site-in-an-iframe/157631 "2020-07-13T19:11:12Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2020年七月14日 00:59 UTC](https://meta.discourse.org/t/embedding-a-whole-discourse-forum-on-another-site-in-an-iframe/157631/2 "2020-07-14T00:59:15Z")

</div>

我们当然无法阻止你尝试在 iframe 中嵌入 Discourse，但正如在其他主题中警告的那样……这种方式预计会比较脆弱且充满问题……而我们并不打算投入时间解决与 iframe 相关的问题。

花时间详细描述你在为 Discourse 设计主题时遇到的问题，以便我们提供帮助和/或改进流程，可能是更明智的选择。在过去几年里，我们已经大幅改进了主题功能，并且我们非常希望在这方面提供支持并尽可能进行优化。

有些元素确实比其他元素更难定制，头部（header）就是其中之一。这是因为为了实现性能提升，我们引入了虚拟 DOM（[https://meta.discourse.org/t/a-tour-of-how-the-widget-virtual-dom-code-in-discourse-works/40347）。](https://meta.discourse.org/t/a-tour-of-how-the-widget-virtual-dom-code-in-discourse-works/40347%EF%BC%89%E3%80%82)

因此，如果你打算在头部插入内容，你需要利用该虚拟 DOM 系统，而不是通过管理后台界面（admin UI）在头部之前或之后添加内容（关于这一点，在 [Developing Discourse Themes & Theme Components](https://meta.discourse.org/t/developer-s-guide-to-discourse-themes/93648/1) 的高级插件 API 部分有所涉及）。此外，#Customization > Theme component 中也有一些操纵头部内容的优秀示例，例如 [https://meta.discourse.org/t/custom-header-links/90588。](https://meta.discourse.org/t/custom-header-links/90588%E3%80%82)

---

_[View the full topic](https://meta.discourse.org/t/embedding-a-whole-discourse-forum-on-another-site-in-an-iframe/157631)._
