Tag Banners

:discourse2: Summary Tag Banners displays the tag name and description in a banner at the top of the page when visiting a tag-filtered topic list (similar to the Category Banners component)
:eyeglasses: Preview Preview on Discourse Theme Creator
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-tag-banners
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

Features

Developer Notes

You can customize these banners with CSS. Each banner gets the tag name(s) appended as a class, for example:

.tag-title-header.tag-banner-art {
  background: salmon;
  color: beige;
}

The banner also works with tag intersections (e.g., community.example.com/tags/intersection/art/new-tag)

In this case, you’d target .tag-banner-art.tag-banner-new-tag for CSS customization.

Settings

Name Description
show on mobile Show tag banners on mobile devices
show tag description Show tag description when available
show above site header Display the banner in the above site header connector.
show below site header Display the banner in the below site header connector.
show above main container Display the banner in the above main container connector, for sites with the sidebar enabled.
remove tag hyphen Remove hyphens from tag names in banners
remove tag underscore Remove underscores from tag names in banners
hide tag icon Hide the tag icon when used along with category banners
show with category banners Show full banner alongside category banners

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

Last edited by @JammyDodger 2024-06-15T16:07:15Z

Check documentPerform check on document:
40 Likes

A post was split to a new topic: ‘tag-banner’ class not being removed when navigating away

Bug: "Required" category of a tag not showing up under "category ..." dropdown

Summary: When creating a new topic from the homepage, all category options surface in the composer—as expected. But when you click into a tag (i.e. navigate to /tag/tag-name), and attempt to compose a new post from that page, all categories surface—except, ironically, the category that has set that particular tag among its requirements.

This problem stopped when disabling this component.

2 Likes