Link in evidenza del banner

:information_source: Summary Banner Featured Links allows you to create a banner of links.
:eyeglasses: Preview Theme Creator
:hammer_and_wrench: Repository GitHub - Arkshine/discourse-banner-featured-links
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

Summary

Banner Featured Links allows you to create a banner of links.
It provides a wide range of customization options.

It’s a feature inspired by the fantastic “Meta Branded” Discourse theme.

Features

The default look – it uses the theme color.
image

The button can be styled separately:
image

You can place the links at various places via the plugin outlet setting.
A list of common locations is provided in the description.

:information_source: I recommend using the Developer Toolbar theme component to see where the plugin outlets are located!

For example, if you want to mimic the Meta Brand theme, use the search-banner-below-input outlet. It assumes you have installed the Search Banner component.

Details

The current style can be achieved with the following settings:

I encourage you to try your style!

Settings

General

Name Description
links Text links to be displayed in the header.
show_for_members Display the links for logged-in users.
show_for_anon Display the links for anonymous users.
display_on_mobile Display the links on mobile devices.
display_on_desktop Display the links on desktop computers.
display on homepage Displays the links on the homepage.
url must contain Enter paths that should display the banner. Add * to the end of the path as a wildcard.
plugin outlet The location to display the links.
Common Locationsabove-main-containerabove-site-headerafter-headerbefore-header-panelbefore-list-areabefore-topic-listbelow-site-headerheader-list-container-bottomtopic-above-post-stream
Search Banner component:
search-banner-below-headlinesearch-banner-below-input

links setting:

Name Description
Icon The FontAwesome icon or emoji to display for the links.
Shortcuts
Windows: Win + .
Mac: Cmd + Ctrl + Space
ChromeOS: Launch + Shift + Space
Title The title of the link.
URL The URL to link to.
Target Opens the linked document:
_blank: in a new window or tab (this is the default)
_self: in the same frame as it was clicked
_parent: in the parent frame
_top: in the full body of the window.

You can also style per-button. It will overwrite the global style.

Name Description
Width The width of the button.
Font The font of the button.
Rounding The amount of rounding to apply to the button.
Background The background color of the button.
Background Hover` The background color of the button when hovered.
Color` The text color of the button.
Color Hover` The text color of the button when hovered.
Border The border of the button.
Border Hover The border of the button when hovered.
Shadow The shadow of the button.
CSS Classname A custom CSS class to apply to the button.
Useful if you want to style the button differently and the settings are not enough.
You can target with .banner-featured-links__link.your-classname {}

Global Styling

Customize the default spacing and look of the links.
You can overwrite the button styling for each link individually.

Buttons Wrapper Styling

Customize the container of the links.

Name Description
buttons wrapper max width The maximum width of the buttons wrapper.
buttons wrapper margin The margin of the buttons wrapper.
mobile buttons wrapper max width The maximum width of the buttons wrapper on mobile.
mobile buttons wrapper margin The margin of the buttons wrapper on mobile.

Buttons Spacing & Text Font

Customize the spacing of the buttons and the font size of the text.

Name Description
buttons justify How to distribute space between and around links.
buttons gap The gap between the buttons.
buttons font The font of the buttons.
mobile buttons justify How to distribute space between and around links on mobile.
mobile buttons gap The gap between the buttons on mobile.
mobile buttons direction The direction of the buttons on mobile.
mobile buttons font The fpnt of the buttons on mobile.

Button Styling

Customize the default look of the buttons.

Name Description
button width The width of the button.
button padding The padding of the button.
button rounding The amount of rounding to apply to the button.
button background The background color of the button.
button background hover The background color of the button when hovered.
button color The text color of the button.
button colo hover The text color of the button when hover.
button border The border of the button.
button border hover The border of the button when hovered.
button shadow The shadow of the button.

Advanced Customization

You can use the following CSS to customize further:

.banner-featured-links {
  &__wrapper {

  }

  &__wrapper-links {

  }

  &__link {

  }
}

If you provide a customization per button, you can provide a class name in the CSS Classname setting.

Then, you can target this way:

.banner-featured-links {
  &__link.myclass {

  }
}

Useful links

Credits

  • Discourse for the idea, inspired by the amazing Meta Branded theme.
  • Don and nolo – They made an initial version; I took some of their ideas.
19 Mi Piace

Un commento meta per migliorare un’introduzione altrimenti di buona qualità di un componente: uno screenshot da un dispositivo mobile. Risparmierebbe tempo nella scelta tra utilità, pro e contro.

2 Mi Piace

Questa è stata un’ispirazione per il tema Meta Branded?

Penso di sì :wink:

3 Mi Piace

Devo averlo letto troppo velocemente: stavo guardando la sezione ‘Credits’ :laughing:

3 Mi Piace

Nessun problema. Ho aggiornato la sezione crediti per renderla più chiara. Grazie!

3 Mi Piace

Ho effettuato una piccola correzione se hai installato il componente per la prima volta. :+1:
Il mio ultimo commit ha rinominato un’impostazione, ma i valori predefiniti non sono stati aggiornati.
Grazie a @manuel per aver segnalato il problema!

5 Mi Piace

Ciao @Arkshine, grazie mille per questo plugin!

Lo uso da un po’, ma dopo aver aggiunto un altro pulsante oggi ha rotto l’intero forum, quindi ora sembra così:

Sai per caso perché potrebbe succedere?

2 Mi Piace

Ehi, questo significa che se rimuovi questo pulsante, non si rompe?

Beh, ho dovuto contattare il team di Discourse per disabilitare il plugin, quindi ora è tutto tornato alla normalità, sì.

Ora sono un po’ titubante a ripristinare le vecchie impostazioni per testare la teoria :sweat_smile:

2 Mi Piace

Capisco, non preoccuparti. Mi dispiace! Sei il primo ad avere questo problema. \nRicordi ancora quali valori hai inserito per il pulsante? Se riesco a riprodurlo, sarebbe d’aiuto!

2 Mi Piace

Certo, grazie mille per il tuo aiuto!

È davvero strano, perché ho apportato delle modifiche non molto tempo fa e ha funzionato benissimo.
Ho rimosso uno dei pulsanti e aggiunto quello nuovo:

Ecco i log, se possono essere utili

[{“url”:“Topics tagged new-widget Widgets”,“target”:“_self”,“button_color_hover”:“#197bff”},{“url”:“Topics tagged In-Progress Progress”,“target”:“_self”,“button_color_hover”:“#197bff”},{“url”:“CSS Codes - Elfsight Community Codes”,“target”:“_self”,“button_color_hover”:“#197bff”},{“url”:“Ask the Community - Elfsight Community Recaps”,“target”:“_self”},{“icon”:“:trophy:”,“text”:"Join our Champion Program! ",“url”:“Elfsight Champion Program: Help us grow our community forum! - Announcements - Elfsight Community”}]

Precedente: [{“url”=>“Topics tagged new-widget”, “icon”=>“:fire:”, “text”=>“New Widgets”, “target”=>“_self”, “button_color_hover”=>“#197bff”}, {“url”=>“Topics tagged In-Progress”, “icon”=>“”, “text”=>“In Progress”, “target”=>“_self”, “button_color_hover”=>“#197bff”}, {“url”=>“CSS Codes - Elfsight Community”, “icon”=>“”, “text”=>“CSS Codes”, “target”=>“_self”, “button_color_hover”=>“#197bff”}, {“url”=>“Ask the Community - Elfsight Community”, “icon”=>“”, “text”=>“Support”, “target”=>“_self”, “button_color_hover”=>“#197bff”}, {“url”=>“Elfsight Champion Program: Help us grow our community forum! - Announcements - Elfsight Community”, “icon”=>“:trophy:”, “text”=>“Join our Champion Program! “, “target”=>”_self”}]

3 Mi Piace

Grazie all’aiuto di @Helga_Razinkova in PM, sono stato in grado di riprodurre il problema.
Ho pubblicato una correzione :+1:.

In breve, il componente non si aspettava che le impostazioni venissero aggiornate tramite Editor Impostazioni e con un campo icon mancante, si verificava un errore.

2 Mi Piace

Questo è brillante! È così completo e personalizzabile; sembra che tu abbia pensato praticamente a tutto.

Ho notato un piccolo bug in cui le icone non sono visibili a volte.

Ecco come appaiono i miei link:
image

Questo è ciò che accade quando:

  1. Usi Chrome (non ho provato altri browser, mi dispiace)
  2. Ti allontani da una pagina con i Banner Featured Links
  3. Ritorni alla pagina usando il pulsante “Indietro” del browser

image

Puoi dimostrarlo tu stesso su ehealthforum.nz

4 Mi Piace

Grazie Nathan! Ho inviato una correzione. Fammi sapere se succede ancora!

4 Mi Piace

Fantastico!!! Tutto risolto.

Ho riscontrato un altro bug UX minore (ma sconcertante):

Il testo sui pulsanti viene ancora catturato dalla pseudo-classe :visited, il che significa che il colore del testo si comporta in modo strano al passaggio del mouse una volta che ogni link è stato visitato.

Questo è senza passaggio del mouse:

image

Questo è al passaggio del mouse prima di visitare (cambiano sia l’icona che il testo)
image

Questo è al passaggio del mouse dopo aver visitato (si noti che l’icona cambia ma non il testo)
image

3 Mi Piace

@nathank Puoi provare ad aggiornare e vedere se va meglio?

2 Mi Piace

Era con un’istanza aggiornata. C’era una piccola PR sul Search Banner, ma nessuna su questo TC da applicare. Indipendentemente, ho fatto una ricompilazione. Ancora lì!

Non viene visualizzato in incognito, immagino perché non salva il mio stato di visitato.

4 Mi Piace

È compatibile con il tema AIR per essere visualizzato in cima alla pagina della community con pulsanti che rimandano a WordPress?