Banner hervorgehobene Links

: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 „Gefällt mir“

Ein Meta-Kommentar zur Verbesserung einer ansonsten guten Einführung einer Komponente: Ein Screenshot von einem Mobiltelefon. Das würde Zeit bei der Entscheidung zwischen Nützlichkeit, Vor- und Nachteilen sparen.

2 „Gefällt mir“

Wurde dies vom Meta Branded-Thema inspiriert?

Ich denke schon :wink:

3 „Gefällt mir“

Habe es wohl zu sehr überflogen – ich habe mir den Abschnitt „Credits“ angesehen :laughing:

3 „Gefällt mir“

Keine Sorge. Ich habe den Abschnitt „Credits“ aktualisiert, um ihn klarer zu gestalten. Danke!

3 „Gefällt mir“

Ich habe einen kleinen Fix eingespielt, falls Sie die Komponente zum ersten Mal installiert haben. :+1:
Mein letzter Commit hat eine Einstellung umbenannt, aber die Standardwerte wurden nicht aktualisiert.
Danke an @manuel für die Meldung des Problems!

5 „Gefällt mir“

Hallo @Arkshine, vielen Dank für dieses Plugin!

Ich benutze es schon seit einer Weile, aber nachdem ich heute einen weiteren Button hinzugefügt habe, hat es das gesamte Forum kaputt gemacht, sodass es jetzt so aussieht:

Weißt du zufällig, warum das passieren könnte?

2 „Gefällt mir“

Hey, bedeutet das, wenn du diesen Button entfernst, funktioniert es nicht mehr?

Nun, ich musste das Discourse-Team kontaktieren, um das Plugin zu deaktivieren, also ist jetzt alles wieder normal, ja.

Jetzt bin ich irgendwie zögerlich, die alten Einstellungen wiederherzustellen, um die Theorie zu testen :sweat_smile:

2 „Gefällt mir“

Ich verstehe, keine Sorge. Entschuldigung dafür! Sie sind der Erste, der dieses Problem hat. Können Sie sich noch erinnern, welche Werte Sie für die Schaltfläche eingegeben haben? Wenn ich es reproduzieren kann, wäre das hilfreich!

2 „Gefällt mir“

Gerne, vielen Dank für Ihre Hilfe!

Das ist wirklich seltsam, da ich vor kurzem Änderungen vorgenommen habe und es einwandfrei funktionierte.
Ich habe einen der Buttons entfernt und den neuen hinzugefügt:

Hier sind die Protokolle, falls sie helfen

[{“url”:“Topics tagged new-widget Widgets”,“target”:“_self”,“button_color_hover”:“#197bff”},{“url”:“Topics tagged In-Progress Bearbeitung”,“target”:“_self”,“button_color_hover”:“#197bff”},{“url”:“https://community.elfsight.com/c/css-codes/158?utm_source=elfsight&utm_medium=elfsight-community&utm_campaign=buttons-under-search&utm_content=css-codes",“icon”:“”,“text”:“CSS-Codes”,“target”:“_self”,“button_color_hover”:“#197bff”},{“url”:“https://community.elfsight.com/c/get-help/5?utm_source=elfsight&utm_medium=elfsight-community&utm_campaign=buttons-under-search&utm_content=support”,“icon”:“”,“text”:“Support”,“target”:“_self”,“button_color_hover”:“#197bff”},{“url”:“https://community.elfsight.com/c/announcements/release-notes/133?utm_source=elfsight&utm_medium=elfsight-community&utm_campaign=buttons-under-search&utm_content=monthly-recaps”,“text”:"Monatliche Zusammenfassungen”,“target”:“_self”},{“icon”:“:trophy:”,“text”:"Treten Sie unserem Champion-Programm bei! ",“url”:“Elfsight Champion Program: Help us grow our community forum! - Announcements - Elfsight Community”}]

Vorher: [{“url” => “Topics tagged new-widget”, “icon” => “:fire:”, “text” => “Neue Widgets”, “target” => “_self”, “button_color_hover” => “#197bff”}, {“url” => “Topics tagged In-Progress”, “icon” => “”, “text” => “In Bearbeitung”, “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” => "Treten Sie unserem Champion-Programm bei! ", “target” => “_self”}]

3 „Gefällt mir“

Dank @Helga_Razinkova’s Hilfe in PM konnte ich das Problem reproduzieren.
Ich habe einen Fix eingespielt :+1:.

Kurz gesagt, die Komponente hat nicht erwartet, dass die Einstellungen über den Einstellungseditor aktualisiert werden, und mit einem fehlenden icon-Feld trat ein Fehler auf.

2 „Gefällt mir“

Das ist brillant! Es ist so umfassend und anpassbar; Sie scheinen an so ziemlich alles gedacht zu haben.

Ich habe einen kleinen Fehler bemerkt, bei dem die Symbole manchmal nicht sichtbar sind.

So sehen meine Links aus:
image

Das passiert, wenn Sie:

  1. Chrome verwenden (andere Browser habe ich leider nicht ausprobiert)
  2. Von einer Seite mit den Banner Featured Links weg navigieren
  3. Mit der ‘Zurück’-Schaltfläche des Browsers zur Seite zurückkehren

image

Sie können dies selbst auf ehealthforum.nz demonstrieren.

4 „Gefällt mir“

Danke Nathan! Ich habe eine Lösung implementiert. Lass mich wissen, ob es immer noch passiert!

4 „Gefällt mir“

Wunderbar!!! Alles behoben.

Habe einen weiteren kleineren (aber beunruhigenden) UX-Bug gefunden:

Der Text auf den Schaltflächen wird immer noch von der :visited-Pseudoklasse erfasst, was bedeutet, dass sich die Textfarbe beim Überfahren mit der Maus seltsam verhält, sobald jeder Link besucht wurde.

Dies ist ohne Hover:

image

Dies ist Hover vor dem Besuch (sowohl Symbol als auch Text ändern sich)
image

Dies ist Hover nach dem Besuch (beachten Sie, dass sich das Symbol ändert, aber nicht der Text)
image

3 „Gefällt mir“

@nathank Kannst du versuchen, ein Update durchzuführen und zu sehen, ob es besser ist?

2 „Gefällt mir“

Das war mit einer aktualisierten Instanz. Es gab einen kleinen PR auf dem Suchbanner, aber keinen auf diesem TC, den man anwenden konnte. Trotzdem habe ich einen Neubau durchgeführt. Immer noch da!

Es wird im Inkognito-Modus nicht angezeigt, vermutlich weil mein besuchter Status nicht gespeichert wird.

4 „Gefällt mir“

Ist dies mit dem AIR-Theme kompatibel, um oben auf der Community-Seite mit Schaltflächen, die zu WordPress verlinken, zu dienen?