Search banner theme component

This is a component that puts a search bar along with optional headline and subhead text in a banner above the main topic list navigation.

By default this banner appears on all top-level topic pages (latest/new/unread/top/categories… anything in the top menu site setting) but it can also be set to only display on a community’s homepage.

:building_construction: Github repo: https://github.com/awesomerobot/discourse-search-banner.git

:telescope: Preview it on theme creator

:question: How do I install a theme component?

:sparkling_heart: This very heavily borrows from @angusHeader Search Theme

Available settings

  • Set the headline and subhead text
  • Show the banner on all top-level topic pages (default), just the homepage, or all pages
  • Show the banner for everyone, logged in, or logged out users
  • Set a background image

Custom styling

The HTML element gets a class named .display-search-banner wherever this banner appears, and the banner itself is wrapped with the .custom-search-banner class, so with some CSS you should be able to customize the appearance of this banner however you see fit.

Future enhancements

  • Add an option to enable the banner in specific categories
46 Likes

Incredible work! :sparkles: Suggestion: add an option to hide this theme component from logged-in users (only visible to visitors/non-users).

4 Likes

Increible work. Thanks for explain this info

This is awesome. is there any way we can put a picture background for the search banner ?

It’s in the theme component settings.

2 Likes

amazing theme component :star_struck: :heart:

it’d be great if it can be merged into other available banner themes, i.e. Versatile Banner, as an option.

1 Like

How do we show search banner everywhere page? Every topic, every category? Thank!

I’ve updated the theme component to add some new settings:

show on — this determines where the banner appears and has the options

  • top_menu (latest/categories/top/new/unread)
  • homepage
  • all (all pages except the default search page and admin pages)

show for — this determines who sees the banner

  • everyone
  • logged_in
  • logged_out
10 Likes

Thanks a lot for this theme!!!

2 Likes

hi, i have a image after header and I want to put this search after this not before, how to make this?

First of all great thing, looks super clean and easy to manage!

Is there any way to add basic html to the description text? I would love to add some icons and links.

Hello,

i wanna setup font-weight of search_banner.subhead become bold follow Css below but not effect

.wrap {
.custom-search-banner-wrap{
    p{
        font-weight: bold;
    }
}}

How can i bold subhead?
Thank you!

i solve, thank you!

.custom-search-banner-wrap h1, .custom-search-banner-wrap p {
text-align: center;
font-weight: bold;}
1 Like

I’ve installed it and it’s really great

Is there any way to display it only to tl0 + tl1 users?

This theme component shows users in search (mobile view) but why doesn’t the normal search bar shows users in mobile search?

1 Like

Brilliant theme @awesomerobot! Thanks a million.

2 Likes

This breaks the layout of my website and also adds an uneven top padding. Could you please fix that?

  1. navigation-container
  2. header

I am using the Mozilla Discourse Theme

1 Like

Hey @awesomerobot
There seems to be an issue with this theme-component with the who’s online plugin.

That is, the user card is being displayed in an irregular fashion when your theme-component is enabled.

After disabling it, it’s aligned the right way. Can you please check this?

(I don’t think this is a theme-specific issue. I tried with all themes including the default one and the issue persists.)

1 Like

There seems to be an issue with the Who’s Online plugin and the official Search banner theme component .

That is, the user card is being displayed in an irregular fashion when this plugin is enabled with that theme-component.

After disabling the theme-component, it’s aligned the right way.
Can you please check if there’s something that you could do on this?
(Something like a fix to always display the user-card below the clicked location, instead of automatically choosing an alignment?)

I don’t think this is a theme-specific issue. I tried with all themes including the default one and the issue persists.

2 Likes

This means it is a problem with the theme component, not the plugin. I’ve made a change to the component that should fix it (also moved your post to the component topic).

4 Likes