# 搜索结果页面顶部的自定义文本

**URL:** <https://meta.discourse.org/t/custom-text-at-top-of-search-results-page/197387>\
**Category:** Support\
**Tags:** search\
**Created:** [2021年七月16日 17:58 UTC](https://meta.discourse.org/t/custom-text-at-top-of-search-results-page/197387 "2021-07-16T17:58:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)\
**Post date:** [2021年七月16日 17:58 UTC](https://meta.discourse.org/t/custom-text-at-top-of-search-results-page/197387/1 "2021-07-16T17:58:21Z")

</div>

是否可以在搜索结果顶部添加一些文本？

谢谢。

---

<div class="post-metadata">

**Author:** ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)\
**Post date:** [2021年七月16日 18:08 UTC](https://meta.discourse.org/t/custom-text-at-top-of-search-results-page/197387/2 "2021-07-16T18:08:56Z")

</div>

好的，在该页面上，搜索结果正上方有一个插件出口，您可以使用它来添加文本。

 ![image](https://global.discourse-cdn.com/meta/original/3X/3/e/3eccf282274f6bae875517f5afb004ae2f869c39.png)

将此代码添加到您主题中的 `common > header` 选项卡：

```xml
<script type="text/x-handlebars" data-template-name="/connectors/full-page-search-below-search-info/add-text-above-results">
  您的文本或标记代码请放在此处...
</script>

```

---

<div class="post-metadata">

**Author:** ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)\
**Post date:** [2021年七月16日 18:14 UTC](https://meta.discourse.org/t/custom-text-at-top-of-search-results-page/197387/3 "2021-07-16T18:14:02Z")

</div>

这非常完美，谢谢。

另外，我能在手机上用一分钟完成操作，也说明了 Discourse 对移动端的友好程度。

有没有办法在不提问的情况下了解这些信息？或者这需要深入理解代码？

---

<div class="post-metadata">

**Author:** ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)\
**Post date:** [2021年七月16日 18:19 UTC](https://meta.discourse.org/t/custom-text-at-top-of-search-results-page/197387/4 "2021-07-16T18:19:18Z")

</div>

我想这就是我补充问题的答案！

> [@Johani](#):
>
> > [@](#):
> >
> > 好的，但我该如何找到这些插件出口（plugin-outlets）呢？
> 
> 查找插件出口（plugin-outlets）最简单的方法是在 Discourse 仓库中搜索 `plugin-outlet`。
> 
> [https://github.com/discourse/discourse/search?q=plugin-outlet](https://github.com/discourse/discourse/search?q=plugin-outlet&unscoped_q=plugin-outlet)

---

<div class="post-metadata">

**Author:** ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)\
**Post date:** [2021年七月16日 18:24 UTC](https://meta.discourse.org/t/custom-text-at-top-of-search-results-page/197387/5 "2021-07-16T18:24:21Z")

</div>

或者，这个组件或许能帮上忙：  
[(deprecated) Plugin outlet locations theme component](https://meta.discourse.org/t/plugin-outlet-locations-theme-component/100673)

---

<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:** [2021年八月15日 18:25 UTC](https://meta.discourse.org/t/custom-text-at-top-of-search-results-page/197387/6 "2021-08-15T18:25:13Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
