Install this theme component
Note
This theme component is only required when sites want to support external searches. Otherwise, you may update the Search experience setting to Search field in site header to move site search to the header.
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 @lindsey 2025-02-28T14:39:07Z
Check document Perform check on document:
37 个赞
我刚刚更新了该组件,这将使默认搜索图标显示在移动设备上:
committed 03:02PM - 25 Jul 22 UTC
6 个赞
miss
(miss)
2022 年7 月 25 日 15:15
18
5 个赞
alanost
(Alan)
2022 年7 月 28 日 15:40
20
您好,首先,这个主题组件非常好,对我来说效果很好。
我有一个小小的改进建议。在需要登录的论坛中不应该显示搜索栏,因为它反正也无法使用。
4 个赞
alanost
(Alan)
2022 年8 月 23 日 21:37
21
如果有人能修复这个错误,我将非常高兴。我知道它影响的人不多,但我喜欢这个主题组件,这个问题阻止了我使用它
1 个赞
我刚刚进行了一项更新,该更新将在需要登录时向未登录用户隐藏搜索栏
main ← login-required
opened 12:55AM - 24 Aug 22 UTC
This prevents the broken search bar from appearing on the `login_required` scree… n
3 个赞
我还添加了一个使用标题颜色(标题主色和标题背景色)的输入更新
main ← 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 个赞
manuel
(Manuel Kostka)
2022 年10 月 10 日 21:05
24
该组件似乎禁用了新的 header-sidebar-toggle。
4 个赞
manuel
(Manuel Kostka)
2022 年10 月 27 日 18:21
27
我遇到的另一个小故障是:我可以使用默认的“/”快捷键进入搜索输入字段。但它不会展开显示结果的下拉菜单。我需要手动单击输入字段才能执行此操作,这使得键盘快捷键有点无用。
1 个赞
manuel
(Manuel Kostka)
2022 年12 月 20 日 20:52
28
使用该组件将再次禁用 header-sidebar-toggle。我猜是因为侧边栏的设置已更改。
2 个赞
ozkn
(Mathx)
2022 年12 月 31 日 22:17
30
@jordan.vidrine 你好,我可以在移动端标题中使用此组件作为默认组件吗?
1 个赞
我发布之前曾考虑过这一点,但移动端标题的空间不足以使其正常工作。
4 个赞
bquast
(Bastiaan Quast)
2023 年3 月 2 日 13:26
32
感谢您提供的出色组件。
有没有办法自定义搜索框边框的颜色?
对我来说,它是灰色的,我希望它是 #FFFFFF 白色
2 个赞
您可以自定义此颜色,方法是将一些 CSS 添加到本地主题组件中,如果您已经创建了一个用于添加自定义 CSS 的组件。
如果您尚未 执行此操作,请访问 /admin/customize/themes 并单击 components ,然后单击 install 。
当弹出模态框时,选择 Create New,然后为您的组件命名。您将被带到组件的新页面,您可以在其中选择要应用它的主题。您需要将其应用于已安装的主题。
要添加 CSS,请单击 Edit CSS/HTML 并将 CSS 添加到 common 页面并保存。
您需要执行类似以下操作:
.search-menu .search-input {
border: 1px solid #FFFFFF
}
2 个赞
bquast
(Bastiaan Quast)
2023 年3 月 6 日 05:04
34
感谢 @jordan.vidrine 提供的详细说明。
我最近已经学会了如何在论坛上从其他好心人的帮助下添加自定义 CSS。
3 个赞
Canapin
(Coin-coin le Canapin)
2023 年3 月 6 日 10:53
35
4 个赞
我可以删除那一行,并使用媒体查询将其禁用直到 768px 而不破坏任何东西吗?
我想在平板电脑上删除该按钮(因为我们有聊天和视频在那里),并且我看到搜索框非常合适。
1 个赞
volanar
(Volanar)
2023 年7 月 13 日 16:25
37
一切都很好,但在移动版本中,您需要切换到标准搜索,因为它看起来很糟糕
vs
1 个赞