First post wikified.
Iâd like to suggest a change from the word âoptionsâ towards a icon. What do you think?
(Maybe as drop down menu with all important settings, like the Hamburger Menu)
Itâs multilingual and saves limited space.
Alternatively I would suggest the icon that is by default used as the search icon. That the âoptionsâ are linked to the search bar isnât always immediately obvious, especially not with the search bar aligned to the right.
You know how sometimes you stumble on a solution and feel silly for not realising it earlier?
It turns out that if we move the search-context stuff into the dropdown (like it is in the search menu) and add a search icon, it solves the visual issue youâre both referring too and also solves various space issues with having the search-context suff in the header.
With results:
Incidentally, it now looks and functions very similarly to Facebook header search.
Commits:
- Plugin: https://github.com/angusmcleod/discourse-header-search/commit/6d8418f519801fdb22737a7d37edd937b40c16b3
- Theme: https://github.com/angusmcleod/discourse-header-search-theme/commit/2c62ed1fa151be8c5bd86d43e87121f61c11e195
Note, the right alignment CSS has changed as a result, see the first post of this topic:
Well done. The plugin looks much more intuitive.
Iâd like to share another idea:
(Only for desktop clients with mouse input): What if the search field will become visible, in case, the user hover over the search symbol? The search field plop out from the right side next to the original location. This would save space and is would make the UX much more responsive.
Iâm not entirely sure I understand what youâre describing, but it sounds like youâre talking about hiding the search input in the header by default? This basically the normal Discourse search UI. No plugin required
Thanks a lot for the work on this. But I noticed a bug. If you enter a topic and scroll until the header search bar is replaced by the default search icon, the search drop-down has an unnecessary additional search icon inside:
Thanks, fixed: https://github.com/angusmcleod/discourse-header-search-theme/commit/f7ce916b66f5ab5ca3f4635222d29b590b02a28a
Fixed:
Thanks for this plugin.
At my site I see a different layout in the search content
This is i the layout at at standard search bar inside a topic
This is when I use the plugin
Any reason why the result lists layout differ?
Thanks for the feedback
By differ, do you mean:
-
blue text colour of the titles;
-
width reduction of the container (which makes more of the text wrap); and/or
-
the context filter box appears in one screenshot but not in the other?
Width reduction
By default the header search input is thinner than normal Discourse search as there is less space in the header. You can change this on your instance if you wish.
All the header search size calculations, e.g. for the responsive break point (the point at which the search header is hidden because the screen is too thin), or the width of the results window, are ultimately derived from the width of the .search-header
class, so you can safely make the search header wider just by increasing the width of that class.
i.e. Set the width of the .search-header
class in Admin > Customize > CSS
.search-header {
width: /// your desired width - default is 350px
}
Topic title color
Personally I think the search results titles should be black as this it makes the .search-highlight
of the search term easier to see.
There is a minor inconsistency with how topic title styles are treated in core Discourse. Compare, for instance, the topic titles in the lists in /u/username/activity
. Some are black, some are blue. All lists of topics are links to topics, so Iâm not sure the answer is that âlinksâ are blue (technically speaking this is actually the answer, i.e. an anchor tag (<a>
) is being used, however this doesnât solve the product-level inconsistency).
But this is minor point, and your implication is right that by default they should reflect the core style (made that change). If anyone wants to change this, just set this CSS rule to whatever you like
.header-search-enabled .search-header a, .header-search-enabled .search-header a:visited {
color: $tertiary;
}
Different context filters in the screenshots
Were those searches were made in different discovery contexts (i.e. when viewing different topic lists or topics)? The context filters seem to be working fine on my testing, e.g. (taken on my sandbox)
Thanks for a very loooooong description
Well yes, basicly my question was how to let the 2 search result list to have the same style/format.
I will look at the code snippets above!
But again a very nice plugin, thanks for the answer!!
just upgraded core:
and now header search looks like:
oh noesâŚ
Thanks, fixed:
** Please note ***
I am removing support for this plugin in favour of the Header Search Theme.
The functionality is exactly the same, but with the advantages of:
- No site stability risk.
- Themes now have setting support.
- Themes are easier to update, particularly now with the theme api.
- Any future header search functionality can be handled within a theme.
- It removes duplication, which is a source of engineering risk.
I am moving this to #plugin:broken-plugin for now, I know it is not stricly broken but its better to move it now than forget about it and move it later.