Banner de Pesquisa Avançada

:warning: Note

We are planning to deprecate support for this theme component soon and advise you to use the welcome banner feature instead.

:discourse2: Summary Advanced Search Banner puts a search bar along with optional headline and subhead text in a banner above the main topic list navigation.
:eyeglasses: Preview Preview on Discourse Theme Creator
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-search-banner
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

Features

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.



Settings

Name Description
show on This determines which pages the banner appears
plugin outlet Where on the page the banner will appear
background image light Background image for the banner on light color palettes
background image dark Background image for the banner on dark color palettes
tile background image Repeat the background image
show for Who can see the Search Banner (logged in, logged out, or both)
special style Optional variations that change the appearance of the search banner
Translation Default
search_banner.headline Welcome to our community
search_banner.subhead We’re happy to have you here. If you need help, please search before you post.
search_banner.search_button_text

To omit one from display, leave the field blank.

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

Credits

:sparkling_heart: This very heavily borrows from @angusPavilion Header Search Theme Component


:discourse2: Hosted by us? Theme components are available to use on our Standard, Business, and Enterprise plans.

83 curtidas
[PAID] New search bar
Bringing popular features to Discourse: Header search, welcome banner, and category icons / emoji
Elementary Layout Component
Searching for users on mobile
New Theme: Tag-Pages Navigation
How to add links on home page menu to other site?
Adding Search option
Header search in custom header
Can't find how to localize a theme component
Mint Theme
Creating and installing plugins?
Bug with "search_banner.search_button_text" shown in search banner theme component
Search banner requires login
Pavilion Header Search Theme Component
Help Needed for Installing Meta Branded Theme
Banner Featured Links
Search section like on Reddit?
How do I edit "Welcome to our community" and tagline on the Homepage?
Anything wrong with this component?
User card out of alignment
Search Banner image cuts off on smaller screens
Pavilion Header Search Theme Component
Where to find search bar in our settings?
Where to find search bar in our settings?
Fully Theme
Welcome Banner components
What plug-in or customization for this header?
Custom Platform
Homepage header, how to add?
How can I make the home page similar to this one?
Theme or Custom CSS on Monday’s Discourse Instance?
Community not displaying correctly - new problem - help!
Christmas Decoration Component :christmas_tree:
We're upgrading our icons to Font Awesome 6!
Search for and/or filter topics in a category using text search
Forum search bar not showing up
Pavilion Header Search Theme Component
3.5.0.beta9: Improving color management, core welcome banner, and staff action log filters
Translations of theme component sample texts
Making my discourse site look a certain way
How can I change the HTML template of advanced search?
How to change the header text on the title page
Advanced Header Search
How to make a custom search bar?
Bug in Search banner theme component
Simple modifications
How can I achieve these header and footer customisations?
Meta Branded theme and all categories header
Search in this topic filter issue with Search banner TC
Bug with "search_banner.search_button_text" shown in search banner theme component
New Theme: Tag-Pages Navigation
Customizing your site with existing theme components

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
17 curtidas

Acabei de fazer uma pequena atualização que adiciona um estilo opcional a este componente, ele fornece uma barra de pesquisa grande sem texto de título:

Isso pode ser ativado por uma nova configuração de “estilo especial”. Tudo o que isso faz é ativar um pequeno CSS adicional.


Talvez eu adicione mais algumas opções aqui no futuro também!

8 curtidas

Como altero a cor do texto de boas-vindas neste complemento?

1 curtida

Não há configuração para isso. No entanto, você pode adicioná-la com um pouco de CSS:

Adicione o seguinte ao seu tema ou a um novo componente de tema e altere como desejar. :+1:

.search-banner > .custom-search-banner  {
    /* title */
    h1 {
        color: #286989;
    }
    
    /* description */
    p {
        color: #286989
    }
}
3 curtidas

Muito obrigado!

2 curtidas

Existe uma maneira de ocultar o ícone de pesquisa (usando CSS ou de outra forma)? Estou tendo um problema em que o ícone de pesquisa está sendo duplicado quando usado em conjunto com este componente: Advanced Header Search - #56 by RBoy

1 curtida
.search-input .search-icon:first-child {
  display: none;
}

deve exibir apenas um ícone de pesquisa. No entanto, devo dizer que usar o banner de pesquisa e a pesquisa no cabeçalho em conjunto tem alguns efeitos colaterais negativos de UX.

Eu recomendaria usar um ou outro.

4 curtidas

Obrigado! Super útil

Você poderia elaborar, quais efeitos colaterais de UX?

1 curtida

O vídeo que linkei acima mostra alguns dos problemas :)\n\n- dropdowns de pesquisa sobrepostos\n- estados estranhos de abertura e fechamento dos dropdowns de pesquisa\n- o ícone de pesquisa é um link para pesquisa avançada em um campo de pesquisa e não no outro\n- etc

2 curtidas

Entendido. Desde que não estejam na mesma página, tudo bem.

2 curtidas

Alguém pode me ajudar? Instalei este tema no meu Discourse, mas a imagem está cortando um pedaço no lado direito, para que a imagem caiba completamente tenho que definir a fonte do site como “Menor” Eu tenho duas instalações diferentes do Discourse e em uma delas a imagem funcionou normalmente, na outra a imagem por que está cortada?

2 curtidas

você pode incluir uma captura de tela? isso tornará muito mais fácil entender o problema

2 curtidas

Eu tenho o mesmo problema que navegadores/modos diferentes mostram partes diferentes dessa imagem. Eu resolvi tornando-a extra larga, então o lado direito só aparece em algumas condições. Mas isso não é tão fácil para imagens simétricas. Acho que mais CSS (sem procurar por uma substituição de componente thome) ajudaria com isso.

Consegui resolver parte, desativei o componente de tema nos outros temas e deixei apenas em 1, por incrível que pareça, a imagem ficou “normal” com o tamanho da fonte em “normal” apenas por causa do celular que só aparece um lado da imagem, será que tem algo que eu possa fazer para que apareça completamente no meu celular também?

Olá,

Existe alguma forma de remover o espaçamento entre o banner de pesquisa e o cabeçalho?

1 curtida

Olá, você pode usar este CSS em um novo componente de tema:

.custom-search-banner-wrap {
    margin-top: 0;
}
3 curtidas

Funcionou perfeitamente, obrigado!

2 curtidas

3 posts foram divididos em um novo tópico: Posso adicionar quebras de linha ao texto do subcabeçalho do banner de pesquisa?

Parece que o Discourse tem o mesmo problema que tenho em minha comunidade, a sobreposição leva algum tempo para cobrir o que está sob a sobreposição de pesquisa (Discover):
2024-07-05 14.42.23

É mais pronunciado em minha comunidade:
2024-07-05 14.49.53

Gostaria de saber se alguém encontrou uma solução para isso, potencialmente um atraso para exibir a sobreposição? Pode levar a uma má experiência.

1 curtida