Liens en vedette dans la bannière

: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 « J'aime »

Un commentaire méta pour améliorer une introduction de composant par ailleurs de bonne qualité : une capture d’écran d’un mobile. Cela permettrait de gagner du temps lors du choix entre l’utilité, les avantages et les inconvénients.

2 « J'aime »

Ceci a été inspiré par le thème Meta Branded ?

Je pense que oui :wink:

3 « J'aime »

J’ai dû le survoler trop rapidement - je regardais la section ‘Crédits’ :rire:

3 « J'aime »

Pas de souci. J’ai mis à jour la section des crédits pour la rendre plus claire. Merci !

3 « J'aime »

J’ai poussé un petit correctif si vous avez installé le composant pour la première fois. :+1:
Mon dernier commit a renommé un paramètre, mais les valeurs par défaut n’ont pas été mises à jour.
Merci à @manuel d’avoir signalé le problème !

5 « J'aime »

Salut @Arkshine, merci beaucoup pour ce plugin !

Je l’utilise depuis un moment, mais après avoir ajouté un autre bouton aujourd’hui, tout le forum s’est cassé et ressemble maintenant à ceci :

Savez-vous pourquoi cela pourrait arriver ?

2 « J'aime »

Hé, est-ce que cela signifie que si vous supprimez ce bouton, cela ne casse pas ?

Eh bien, j’ai dû contacter l’équipe Discourse pour désactiver le plugin, donc tout est de retour à la normale, ouais.

J’hésite maintenant à restaurer les anciens paramètres pour tester la théorie :sweat_smile:

2 « J'aime »

Je comprends, ne vous inquiétez pas. Désolé pour ça ! Vous êtes le premier à avoir ce problème. Vous souvenez-vous encore des valeurs que vous avez saisies pour le bouton ? Si je peux le reproduire, ce serait utile !

2 « J'aime »

Bien sûr, merci beaucoup pour votre aide !

C’est vraiment bizarre, car j’ai fait des modifications il n’y a pas longtemps et ça fonctionnait très bien.
J’ai supprimé un des boutons et ajouté le nouveau :

Voici les journaux, si cela peut aider

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

Précédent : [{“url” => “Topics tagged new-widget”, “icon” => “:fire:”, “text” => “Nouveaux Widgets”, “target” => “_self”, “button_color_hover” => “#197bff”}, {“url” => “Topics tagged In-Progress”, “icon” => “”, “text” => “En cours”, “target” => “_self”, “button_color_hover” => “#197bff”}, {“url” => “CSS Codes - Elfsight Community”, “icon” => “”, “text” => “Codes CSS”, “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” => "Rejoignez notre programme Champion ! ", “target” => “_self”}]

3 « J'aime »

Grâce à l’aide de @Helga_Razinkova en MP, j’ai pu reproduire le problème.
J’ai poussé un correctif :+1:.

En bref, le composant ne s’attendait pas à ce que les paramètres soient mis à jour via Éditeur de paramètres et une erreur s’est produite avec un champ icon manquant.

2 « J'aime »

C’est brillant ! C’est tellement complet et personnalisable ; vous semblez avoir pensé à presque tout.

J’ai remarqué un petit bug où les icônes ne sont pas visibles par moments.

Voici à quoi ressemblent mes liens :
image

Voici ce qui se passe lorsque vous :

  1. Utilisez Chrome (je n’ai pas essayé d’autres navigateurs, désolé)
  2. Quittez une page contenant les liens mis en avant de la bannière
  3. Revenez à la page en utilisant le bouton “Retour” du navigateur

image

Vous pouvez le démontrer vous-même sur ehealthforum.nz

4 « J'aime »

Merci Nathan ! J’ai apporté une correction. Dis-moi si cela se produit toujours !

4 « J'aime »

Merveilleux !!! Tout est réparé.

J’ai trouvé un autre bug d’UX mineur (mais déconcertant) :

Le texte des boutons est toujours capturé par la pseudo-classe :visited, ce qui signifie que la couleur du texte se comporte étrangement au survol une fois que chaque lien a été visité.

Ceci est sans survol :

image

Ceci est au survol avant la visite (l’icône et le texte changent)
image

Ceci est au survol après la visite (notez que l’icône change mais pas le texte)
image

3 « J'aime »

@nathank Pouvez-vous essayer de mettre à jour pour voir si c’est mieux ?

2 « J'aime »

C’était avec une instance mise à jour. Il y avait une petite PR sur la bannière de recherche, mais aucune sur ce TC à appliquer. Néanmoins, j’ai refait une compilation. Toujours là !

Cela ne s’affiche pas en mode incognito, je suppose parce qu’il n’enregistre pas mon statut de visite.

4 « J'aime »

Est-ce compatible avec le thème AIR pour servir en haut de la page Communauté avec des boutons liant vers un wordpress ?