# 如何将已打开的搜索框替换为可点击的图标？

**URL:** https://meta.discourse.org/t/help-on-putting-an-opened-search-box-instead-of-a-clickable-icon/49673
**Category:** Support
**Created:** [2016年九月3日 14:17 UTC](https://meta.discourse.org/t/help-on-putting-an-opened-search-box-instead-of-a-clickable-icon/49673 "2016-09-03T14:17:32Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2016年九月3日 14:17 UTC](https://meta.discourse.org/t/help-on-putting-an-opened-search-box-instead-of-a-clickable-icon/49673/1 "2016-09-03T14:17:32Z")

</div>

trying to put the search box in the header by default, i.e. this opened up search box:

![](https://global.discourse-cdn.com/meta/original/3X/4/6/4619f2be57fa947d5feb8c4b93543c9c13bb42ce.png)

can anyone help me?

---

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2016年九月4日 08:11 UTC](https://meta.discourse.org/t/help-on-putting-an-opened-search-box-instead-of-a-clickable-icon/49673/2 "2016-09-04T08:11:42Z")

</div>

so far i paste the search-bar code in the header:

```plaintext
<div class="panel-body">
    <div class="panel-body-contents clearfix">
    <input placeholder="جستجوی موضوعات، نوشته ها، کاربران یا دسته‌ بندی ها" value="" id="search-term" type="text">
        
        <div class="search-context">      
        <a title="گزینه ها" class="widget-link show-help">گزینه ها </a>
            <div class="clearfix">
            </div>
        </div>
    </div>
</div>

```

and now there exist a search panel in the header of the site, which needs some css of course.

**but more importantly it’'s non-functional.**

does anyone have any idea how to make it functional? what javascript code should i put there to call the search function of discourse?

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [2016年九月4日 11:58 UTC](https://meta.discourse.org/t/help-on-putting-an-opened-search-box-instead-of-a-clickable-icon/49673/3 "2016-09-04T11:58:59Z")

</div>

Isn’t this what you want?

> [@Header search plugin](https://meta.discourse.org/t/header-search-plugin/36435):
>
> \*\* Please note \*\*\* I am no longer supporting this plugin. Please use the [Header Search Theme](https://meta.discourse.org/t/header-search-theme/67959) instead. [See further](https://meta.discourse.org/t/header-search-plugin/36435/97). Repo: [GitHub - angusmcleod/discourse-header-search: A Discourse plugin that makes the search bar visible in the header](https://github.com/angusmcleod/discourse-header-search) Also available as a theme: [Pavilion Header Search Theme Component](https://meta.discourse.org/t/header-search-theme/67959) Makes the search bar visible in the header in the Desktop UI and hides the search menu icon. It only affects the Desktop UI. It does not affect mobile web. When you scroll down on a …

---

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2016年九月4日 12:18 UTC](https://meta.discourse.org/t/help-on-putting-an-opened-search-box-instead-of-a-clickable-icon/49673/4 "2016-09-04T12:18:07Z")

</div>

Thanks Cpardio, that was exactly what I was looking. 😃

“header search” seems to be a straight search keyword here, i don’t know why i just tried “open search panel” and things like this!

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2024年六月8日 12:45 UTC](https://meta.discourse.org/t/help-on-putting-an-opened-search-box-instead-of-a-clickable-icon/49673/5 "2024-06-08T12:45:20Z")

</div>

此主题已在 2834 天后自动关闭。不再允许回复。
