Install this theme component
Features
Settings
Name
Description
extra search icons
Add extra icons to the search bar (for example to trigger an external search).
svg icons
Optionally show external search icons
Use the extra_search_icons
to show additional icons in the search bar.
This setting supports the following params:
prefix
: the prefix to the search URL when clicking the respective icon
icon
: icon to show, from the Font Awesome set (may need to be added to the svg icons
setting as well)
target
: optionally set to “_blank” to open the link in its own tab/window by default
showInCategories
: category IDs where the given icon should be shown exclusively (by default, icon is shown everywhere)
excludeFromCategories
: category IDs where the given icon should not be shown
Credits
Thanks to @Johani for the search panel javascript code
Hosted by us? Theme components are available to use on our Standard, Business, and Enterprise plans.
Last edited by @JammyDodger 2024-06-12T21:32:41Z
Check document Perform check on document:
36 Likes
I’ve just made an update to the component, this will make the default search icon appear on mobile:
committed 03:02PM - 25 Jul 22 UTC
6 Likes
alanost
(Alan)
July 28, 2022, 3:40pm
20
Hello, first of all really good theme component. Works very well for me.
I have a small suggestion for improvement. The search bar should certainly not be displayed in a login-required forum, since it can not be used anyway.
4 Likes
alanost
(Alan)
August 23, 2022, 9:37pm
21
I would be very happy if someone can fix this bug. I know it doesn’t affect many, but I love this theme component and this problem keeps me from using it
1 Like
I’ve just made an update that will hide the search bar from logged out users when login is required
discourse:main
← discourse:login-required
opened 12:55AM - 24 Aug 22 UTC
This prevents the broken search bar from appearing on the `login_required` scree… n
3 Likes
I’ve also added an update that uses the header colors (header primary and header background) for the input
discourse:main
← discourse:color-updates
opened 01:46AM - 24 Aug 22 UTC
We weren't using the header color variables here, so they would clash in some pa… lettes.
Also, the 🔎 button has no function in this context, so I disabled pointer events and improved spacing a little.
4 Likes
nolo
(Manuel)
October 10, 2022, 9:05pm
24
The component seems to disable the new header-sidebar-toggle.
4 Likes
keegan
(Keegan George)
October 12, 2022, 4:46pm
26
Thanks for identifying this @nolo !
I’ve just pushed out a fix
committed 04:45PM - 12 Oct 22 UTC
6 Likes
nolo
(Manuel)
October 27, 2022, 6:21pm
27
Another small glitch I came across: I can use the default “/” shortcut to enter the search input field. But it won’t expand the drop-down showing results. I’d need to click in the input field manually for that to happen which makes the keyboard shortcut kind of useless.
1 Like
nolo
(Manuel)
December 20, 2022, 8:52pm
28
Using the component disables the header-sidebar-toggle again. I guess it’s because the settings for the sidebar changed.
2 Likes
ozkn
(Mathx)
December 31, 2022, 10:17pm
30
@jordan-vidrine Hi, can i use this component as default in mobile header
1 Like
I had considered this before releasing, but there isn’t enough room in the mobile header for this to work properly.
4 Likes
bquast
(Bastiaan Quast)
March 2, 2023, 1:26pm
32
Thank you for the great component.
Is there a way to customize the color of the border of the search box?
For me it is kind of grey, I’d love for it to be #FFFFFF
white
2 Likes
You can customize this color by adding some css to a local theme-component if you have one you’ve created for adding custom css.
If you havent done this, visit /admin/customize/themes
and click on components , then install .
When the modal pops up, select to Create New
, then name your component. You will be taken to the component’s new page where you can select the theme to apply it to. You will want to apply it to the installed theme.
To add the css, click on Edit CSS/HTML and add the css to the common
page and save.
You will want to do something like this:
.search-menu .search-input {
border: 1px solid #FFFFFF
}
2 Likes
bquast
(Bastiaan Quast)
March 6, 2023, 5:04am
34
Thank you @jordan-vidrine for the detailed instructions.
I had recently already learned with help from other good people on this forum to add custom CSS.
3 Likes
Canapin
(Coin-coin le Canapin)
March 6, 2023, 10:53am
35
This might be of some help for further modifications
https://meta.discourse.org/t/make-css-changes-on-your-site/168101#how-do-i-find-which-selectors-to-use-6
It explains how to find which element to target with CSS.
4 Likes
Can I remove that line and use media queries to disable it until 768px without breaking everything?
I like to remove the button (because we have chats and video there) on tablet and I see the search box fit’s really OK.
1 Like
volanar
(Volanar)
July 13, 2023, 4:25pm
37
Everything is fine, but in the mobile version you need to switch to the standard search, because it looks terrible
vs
1 Like