# Header 搜索插件

**URL:** https://meta.discourse.org/t/header-search-plugin/36435
**Category:** Plugin
**Tags:** deprecated
**Created:** [2015年十二月8日 19:05 UTC](https://meta.discourse.org/t/header-search-plugin/36435 "2015-12-08T19:05:57Z")
**Posts on this page:** 20
**Page:** 3

<div class="post-metadata">

### Author: ![David\_Scharf](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david_scharf/32/121389_2.png) [@David\_Scharf](https://meta.discourse.org/u/David_Scharf)
#### Post date: [2016年十月25日 12:42 UTC](https://meta.discourse.org/t/header-search-plugin/36435/42 "2016-10-25T12:42:24Z")

</div>

Hey @angus, thanks and no worries. We’ve gone live now without the plugin and I’ll have to find a quite time to sneak it in and test it out 🙂

Dave

---

<div class="post-metadata">

### Author: ![pradeepkumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pradeepkumar/32/119914_2.png) [@pradeepkumar](https://meta.discourse.org/u/pradeepkumar)
#### Post date: [2016年十一月5日 12:10 UTC](https://meta.discourse.org/t/header-search-plugin/36435/43 "2016-11-05T12:10:58Z")

</div>

Hi @angus, thanks for the update mate, but still I’m not able to get the header search box back. I checked the plugin settings, still…

Is there any Discourse forum using our ‘Header Search’ plugin at the moment? I can speak with the owner, maybe it’s conflicting with the other plugins I installed, I dunno what’s the reason here.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2016年十一月5日 13:01 UTC](https://meta.discourse.org/t/header-search-plugin/36435/44 "2016-11-05T13:01:35Z")

</div>

Hey @pradeepkumar link me to your discourse instance and I’ll take a look at the DOM.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2016年十一月24日 19:35 UTC](https://meta.discourse.org/t/header-search-plugin/36435/45 "2016-11-24T19:35:46Z")

</div>

I’ve just committed a big refactor of this plugin. If you were having trouble with it previously please try it now.  
cc @pradeepkumar

[https://github.com/angusmcleod/discourse-header-search/commit/d51c78b2fc57dfe3ba6bf145f6fc43fe5e7034fa](https://github.com/angusmcleod/discourse-header-search/commit/d51c78b2fc57dfe3ba6bf145f6fc43fe5e7034fa)

---

<div class="post-metadata">

### Author: ![Nam\_Nguyen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nam_nguyen/32/68634_2.png) [@Nam\_Nguyen](https://meta.discourse.org/u/Nam_Nguyen)
#### Post date: [2016年十二月6日 07:28 UTC](https://meta.discourse.org/t/header-search-plugin/36435/46 "2016-12-06T07:28:54Z")

</div>

When I enabled this plugin, the Advance search cannot translate to other language, English is default , is this a bug? 🙂

---

<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年十二月6日 11:05 UTC](https://meta.discourse.org/t/header-search-plugin/36435/47 "2016-12-06T11:05:49Z")

</div>

Which text in particular? As I see the plugin has only a single language translated… english.

> **[discourse-header-search/config/locales at master ·...](https://github.com/angusmcleod/discourse-header-search/tree/master/config/locales)**
>
> master/config/locales

So if it is the string in those files, you might want to consider providing a PR to translate it into your language.

---

<div class="post-metadata">

### Author: ![Nam\_Nguyen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nam_nguyen/32/68634_2.png) [@Nam\_Nguyen](https://meta.discourse.org/u/Nam_Nguyen)
#### Post date: [2016年十二月6日 11:12 UTC](https://meta.discourse.org/t/header-search-plugin/36435/48 "2016-12-06T11:12:55Z")

</div>

I fork this plugin, and add Vietnamese files (client.vi.yml and server.vi.yml to [locales](https://github.com/angusmcleod/discourse-header-search/tree/master/config/locales) ), translate from original English files.

---

<div class="post-metadata">

### Author: ![Nam\_Nguyen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nam_nguyen/32/68634_2.png) [@Nam\_Nguyen](https://meta.discourse.org/u/Nam_Nguyen)
#### Post date: [2017年四月4日 14:38 UTC](https://meta.discourse.org/t/header-search-plugin/36435/49 "2017-04-04T14:38:55Z")

</div>

Header Search Plugin have errors after install on Discourse v1.8.0.beta9 +81

```
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake assets:precompile' failed with return #<Process::Status: pid 386 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
708e81806d63a7035149671d978fce44e09fb1b441b67c37a5202c949d806a6a
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one

```

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2017年四月4日 17:36 UTC](https://meta.discourse.org/t/header-search-plugin/36435/50 "2017-04-04T17:36:06Z")

</div>

Are you seeing errors specific to the header search plugin?

I’ve re-installed this plugin on my [dev site](https://dev.civll.com/) running the latest Discourse and it’s working fine.

 ![](https://global.discourse-cdn.com/meta/original/3X/5/d/5d06f6c1550f1c5bfea05dc8ce1de043dd854cf7.png)

---

<div class="post-metadata">

### Author: ![Nam\_Nguyen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nam_nguyen/32/68634_2.png) [@Nam\_Nguyen](https://meta.discourse.org/u/Nam_Nguyen)
#### Post date: [2017年四月5日 04:51 UTC](https://meta.discourse.org/t/header-search-plugin/36435/51 "2017-04-05T04:51:41Z")

</div>

Hi @angus header search plugin work well on latest discourse 😃, it’s my mistake when I install plugin 😔 Thank you!

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2017年八月13日 09:45 UTC](https://meta.discourse.org/t/header-search-plugin/36435/52 "2017-08-13T09:45:00Z")

</div>

This plugin can now also be installed as a theme 🙂

> [@Pavilion Header Search Theme Component](https://meta.discourse.org/t/header-search-theme/67959):
>
> warning This theme component is no longer maintained. See [below](https://meta.discourse.org/t/pavilion-header-search-theme-component/67959/70) for more information Alternatives include [Advanced Header Search](https://meta.discourse.org/t/header-search/194093) and [Advanced Search Banner](https://meta.discourse.org/t/search-banner/122939) Repository: [GitHub - paviliondev/discourse-header-search-theme](https://github.com/angusmcleod/discourse-header-search-theme)[Preview on Theme Creator](https://theme-creator.discourse.org/theme/awesomerobot/header-search) This is a re-packaging of the [Header Search Plugin](https://meta.discourse.org/t/header-search-plugin/36435) so it can be used as a theme. The functionality is the same as the plugin. See further: [https://meta.discourse.org/t/moving-the-discourse-search-box-and-making-it-functional-how/1504…](https://meta.discourse.org/t/moving-the-discourse-search-box-and-making-it-functional-how/15043/16)

---

<div class="post-metadata">

### Author: ![Pawel\_Kosiorek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pawel_kosiorek/32/75785_2.png) [@Pawel\_Kosiorek](https://meta.discourse.org/u/Pawel_Kosiorek)
#### Post date: [2017年八月31日 09:32 UTC](https://meta.discourse.org/t/header-search-plugin/36435/53 "2017-08-31T09:32:38Z")

</div>

Hi!

Search bar works great!

On my forum users got two options, day and night mode. In day mode everything looks great, but in night mode it’s too bright for most of them.

 ![](https://global.discourse-cdn.com/meta/original/3X/5/6/56d94e0b980197ae8b9cda98525b5f1b53c8cfa9.PNG)

Is it possible to change search background colour depends of chosen theme?

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [2017年八月31日 20:36 UTC](https://meta.discourse.org/t/header-search-plugin/36435/54 "2017-08-31T20:36:00Z")

</div>

You’ll have to add some css on your customize section on your dark theme :

The file where you can find everything you need : [discourse-header-search/assets/stylesheets/header-search.scss at master · angusmcleod/discourse-header-search · GitHub](https://github.com/angusmcleod/discourse-header-search/blob/master/assets/stylesheets/header-search.scss)

And some examples :

```
#search-term {
    background-color: #f1f1f1;
}

#search-term.searching-background {
      background-color:rgba(0, 136, 204, 0.2);
}

```

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2017年八月31日 23:21 UTC](https://meta.discourse.org/t/header-search-plugin/36435/55 "2017-08-31T23:21:31Z")

</div>

I’ve updated [this plugin](https://github.com/angusmcleod/discourse-header-search) and the equivalent [theme](https://github.com/angusmcleod/discourse-header-search-theme/commit/6f7fcbd9b03119c13edb9036884ee41805d78234) to use the relevant scss variables. No need to change your css 🙂

---

<div class="post-metadata">

### Author: ![11145](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/11145/32/119636_2.png) [@11145](https://meta.discourse.org/u/11145)
#### Post date: [2017年九月1日 04:52 UTC](https://meta.discourse.org/t/header-search-plugin/36435/56 "2017-09-01T04:52:51Z")

</div>

In Russian, the phrase “Advanced Search” does not look right.

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

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [2017年九月1日 11:28 UTC](https://meta.discourse.org/t/header-search-plugin/36435/57 "2017-09-01T11:28:34Z")

</div>

The problem is that “advanced search” is inside the search box instead on the right because, when you are on a topic page appears the “Search this topic” box on the right.

The easiest way to fix it is to look for shorter terms to use in the placeholder and replace “advanced search” using “options”. And change it in the russian translation on Github.

You can fix it locally in various ways using CSS but the best solution is something that can be usefull for all russian sites that use this plugin.

---

<div class="post-metadata">

### Author: ![Pawel\_Kosiorek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pawel_kosiorek/32/75785_2.png) [@Pawel\_Kosiorek](https://meta.discourse.org/u/Pawel_Kosiorek)
#### Post date: [2017年九月4日 09:16 UTC](https://meta.discourse.org/t/header-search-plugin/36435/58 "2017-09-04T09:16:02Z")

</div>

@angus  
Now it looks just awesome! Thanks!  
 ![image](https://global.discourse-cdn.com/meta/original/3X/4/c/4cb6bede7eeac809d1099fa0bce60cb7cd8b355d.png)

---

<div class="post-metadata">

### Author: ![Ehud\_Adler](https://avatars.discourse-cdn.com/v4/letter/e/edb3f5/32.png) [@Ehud\_Adler](https://meta.discourse.org/u/Ehud_Adler)
#### Post date: [2017年十月8日 21:15 UTC](https://meta.discourse.org/t/header-search-plugin/36435/59 "2017-10-08T21:15:26Z")

</div>

When i install the plugin, whether i have extra info enabled or not, all i get is this.  
 ![13 PM](https://global.discourse-cdn.com/meta/optimized/3X/7/7/77a5b9c670e34c14de859708a1639d684346092d_2_690x71.png)

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2017年十月16日 13:47 UTC](https://meta.discourse.org/t/header-search-plugin/36435/60 "2017-10-16T13:47:16Z")

</div>

It looks like you’re using an old version of the plugin there. That funky background was removed a while ago. Try rebuilding your container.

I’ve added this plugin to [my sandbox](https://discourse.angusmcleod.com.au/) to give an example of the latest version in action with the latest Discourse.

 ![21 PM](https://global.discourse-cdn.com/meta/original/3X/3/2/32023464c32673309c23c383b5f37551cb599668.png)

---

<div class="post-metadata">

### Author: ![supernaturally](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@supernaturally](https://meta.discourse.org/u/supernaturally)
#### Post date: [2017年十一月2日 19:29 UTC](https://meta.discourse.org/t/header-search-plugin/36435/61 "2017-11-02T19:29:27Z")

</div>

Running v1.9.0.beta14 +43, the Header plugin is creating a floating group that entirely disables the navbar below it (Latest, new, unread ,etc.):

 ![floatinggroupissue](https://global.discourse-cdn.com/meta/original/3X/7/6/769f37a42f39aae4c39b73e896e3677ad016197b.jpg)

@angus - the same happens inside of your sandbox. All this said, great plugin btw! It’s very useful for my application.

[上一頁](https://meta.discourse.org/t/header-search-plugin/36435.md?page=2)

[下一頁](https://meta.discourse.org/t/header-search-plugin/36435.md?page=4)
