Banner de búsqueda avanzada

: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 Me gusta
[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 Me gusta

Acabo de hacer una pequeña actualización que añade un estilo opcional a este componente, te da una barra de búsqueda grande sin texto de título:

Esto se puede habilitar con una nueva configuración de “estilo especial”. Todo lo que hace es habilitar un pequeño CSS adicional.


¡Es posible que añada más opciones aquí en el futuro!

8 Me gusta

¿Cómo cambio el color del texto de bienvenida en este complemento?

1 me gusta

No hay una configuración para eso. Sin embargo, puedes añadirla con algo de CSS:

Añade lo siguiente a tu tema o a un nuevo componente temático, y cambia como desees. :+1:

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

    /* description */
    p {
        color: #286989
    }
}
3 Me gusta

¡Muchas gracias!

2 Me gusta

¿Hay alguna forma de ocultar el icono de búsqueda (usando CSS o de otra manera)? Tengo un problema en el que el icono de búsqueda se duplica cuando se usa junto con este componente: Advanced Header Search - #56 by RBoy

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

solo debería mostrar un icono de búsqueda. Sin embargo, debo decir que usar el banner de búsqueda y la búsqueda del encabezado de forma conjunta tiene algunos efectos secundarios negativos en la experiencia del usuario.

Recomendaría usar solo uno u otro.

4 Me gusta

¡Gracias! Súper útil

¿Podrías dar más detalles, qué efectos secundarios en la experiencia del usuario?

1 me gusta

El video que enlacé arriba muestra algunos de los problemas :slight_smile:

  • menús desplegables de búsqueda superpuestos
  • estados extraños abiertos y cerrados de los menús desplegables de búsqueda
  • el icono de búsqueda es un enlace a la búsqueda avanzada en una entrada de búsqueda y no en la otra
  • etc.
2 Me gusta

Entendido. Entonces, siempre que no estén juntos en la misma página, debería estar bien.

2 Me gusta

¿Alguien puede ayudarme? Instalé este tema en mi Discourse pero la imagen se corta en el lado derecho, para que la imagen encaje completamente tengo que configurar la fuente del sitio en “Más pequeño”. Tengo dos instalaciones diferentes de Discourse y en una de ellas la imagen funcionó normalmente, en la otra, ¿por qué se corta la imagen?

2 Me gusta

¿Puedes incluir una captura de pantalla? Esto hará que sea mucho más fácil entender el problema.

2 Me gusta

Tengo el mismo problema de que diferentes navegadores/modos muestran diferentes partes de esa imagen. Lo resolví haciéndola extra ancha, de modo que el lado derecho solo se muestre en algunas condiciones. Pero eso no es tan fácil para imágenes simétricas. Supongo que algo más de CSS (sin buscar una sobrescritura de componente thome) ayudaría con eso.

Logré resolver parte de ello, deshabilité el componente de tema en los otros temas y lo dejé solo en 1, por increíble que parezca, la imagen estaba “normal” con el tamaño de fuente en “normal” solo por el teléfono celular que solo aparece un lado de la imagen, ¿será ¿Hay algo que pueda hacer para que aparezca completamente en mi teléfono celular también?

Hola,

¿Hay alguna forma de eliminar el espacio entre el banner de búsqueda y el encabezado?

1 me gusta

Hola, puedes usar este CSS en un nuevo componente de tema:

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

¡Funcionó perfectamente, gracias!

2 Me gusta

3 publicaciones se dividieron en un nuevo tema: ¿Puedo agregar saltos de línea al texto del subencabezado del banner de búsqueda?

Parece que Discourse tiene el mismo problema que tengo en mi comunidad, la superposición tarda un tiempo en cubrir lo que hay debajo de la superposición de búsqueda (Discover):
2024-07-05 14.42.23

Es más pronunciado en mi comunidad:
2024-07-05 14.49.53

Me pregunto si alguien ha encontrado una solución para eso, ¿potencialmente un retraso en la visualización de la superposición? Podría llevar a una mala experiencia.

1 me gusta