高级搜索横幅

Not entirely sure what’s causing this, but it seems like it is probably related to Themeable site settings are now available

Which theme are you using? How are these settings for the theme configured?

I think if you have search field in site header set and this component installed, you end up in the state you describe where search is only in the banner and doesn’t appear in the header at all… does that sound accurate?

Using the default theme and these are the settings.

1 个赞

Any idea the root cause and if needs a component fix or discourse fix?

I updated one of my sites and this theme component got… squished.

Unfortunately, I don’t have a screenshot of what the homepage looked like before the update, but I’ll post a screenshot of what it looks like now. It’s basically been smashed so it’s not as tall as it used to be.

And here’s the original banner, the search bar used to be in the open area that’s now missing.

1 个赞

Looks like it’s not an issue with the search banner per se.

I made sure to uncheck the box to update theme component with Discourse updates, then I updated my other production site, and that one shrunk the banner as well.

How do I get the original banner size back? These smaller ones are ugly.

Found a screenshot of pre-update on my 2nd site.

What it used to look like:

And now:

The admin notice is for an unrelated bit of code and does not exist on my other site.

Same here, for some reason my banner broken

try this temporary fix => desktop => common

.search-banner {
    background-image: url(https://segredin.com/uploads/default/original/1X/3f044a906d2c358806610fc756e09991d25323ed.webp);
    background-size: cover;
    background-repeat: no-repeat;
    border-radius: 15px;
    margin-bottom: 10px !important;
    height: 17em;
    padding-top: 50px
}

@edit

Thanks, that fixes the size of the banner, but the contents are at the top instead of centered.

1 个赞

Fixed with padding-top: 50px

1 个赞

Of course this is still 100% broken in moblle.

1 个赞

What your site? on mobile this search banner simply disappear maybe some class changed idk.

Looks like a variable’s name was changed and that broke the padding, I’ve just added a fix FIX: restore padding broken due to missing variable by awesomerobot · Pull Request #100 · discourse/discourse-search-banner · GitHub

So you should be able to restore the previous spacing by updating the component.

Yeah there’s a simpler version of the banner included in Discourse by default now, and there’s some CSS to hide it on mobile… it can be restored with some custom CSS

@use "lib/viewport";

@include viewport.until(sm) {
  .welcome-banner {
    display: block;
  }
}
5 个赞

Perfect, thanks so much for restoring this component!

Does this component track usage data? We’d like to see how effective it actually is for our community.

@bartv No, I don’t believe it does.

It doesn’t seem to have fixed the issue. The search bar in the top site header section just doesn’t appear. I just updated to the latest 3.6.0 Beta1-Dev and problem still exists. The only way I can get back the search bar in the top site header is to disable this component and enable the Discourse Header Search component or enable Search bar in site header for the theme, but the moment I enable this component they all disappear from the site header.

Any idea why this has stopped working? This was one of the nicest components I used, I really miss it’s features.

I guess that answers my question. After the latest update to the Welcome banner, I just enabled that and it seems to replace the functionality of this component as well as the Discourse Header Search.

The welcome banner is still missing some nice customization this component has like the ability to add a subhead text (extremely helpful as it can prompt users to use the search bar rather than just lie there like an empty box). Hopefully that will make it’s way into the Welcome banner.

On the flip side, is there a way to use the CSS customization feature in discourse to edit the subheading text in the search banner ?

Are you referring to this Advanced Search Banner component? If so, I believe this setting does this:

No, I’m referring to the text inside the search box that says Search

1 个赞

You can change the text variable js.search.title in /admin/customize/site_texts.

But as you mentioned in Creating a banner to display at the top of your site - #23 by RBoy, the more specific variable should be js.welcome_banner.search- but it doesn’t seem to work right now.

2 个赞