# Category Banners

**URL:** https://meta.discourse.org/t/category-banners/86241
**Category:** Theme component
**Tags:** official, category-banners
**Created:** [April 26, 2018, 6:05pm UTC](https://meta.discourse.org/t/category-banners/86241 "2018-04-26T18:05:47Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [April 29, 2021, 9:03pm UTC](https://meta.discourse.org/t/category-banners/86241/136 "2021-04-29T21:03:36Z")

</div>

No… Discourse doesn’t store descriptions for tags, only categories, so it wouldn’t be possible with this component.

It would be possible to modify the tag banner component to add descriptions in a theme setting… but if you plan on having more than a couple dozen tags it would start to become unwieldy, so it’s not a great option.

The best path would be to create a plugin that adds a description functionality to tags… though that would be significantly more complex.

---

<div class="post-metadata">

### Author: ![Drew-ART](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Drew-ART](https://meta.discourse.org/u/Drew-ART)
#### Post date: [April 30, 2021, 12:04am UTC](https://meta.discourse.org/t/category-banners/86241/137 "2021-04-30T00:04:06Z")

</div>

Doesn’t this component pull text from the 1st paragraph of the 1st post in the category if its not set in the category’s settings? The default ‘about’ one. Thats always how i use it.

What about a plugin which auto-creates a default ‘about’ page for each tag-page. Would it be a possible, or a good path to go down, to create that and then point your plugin at that post if its set to work on tag-pages?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [May 1, 2021, 1:02am UTC](https://meta.discourse.org/t/category-banners/86241/138 "2021-05-01T01:02:54Z")

</div>

> [@Drew-ART](#):
>
> Doesn’t this component pull text from the 1st paragraph of the 1st post in the category if its not set in the category’s settings? The default ‘about’ one. Thats always how i use it.

Yes, but Discourse pulls that text out of the post and I sets it as the category description… so most of the work is already done, I just reused it here.

It might be possible to get the oldest topic with a specific tag and use that as the description so the functionality is similar? I’ll have to look into it some more.

---

<div class="post-metadata">

### Author: ![craigconstantine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/craigconstantine/32/511195_2.png) [@craigconstantine](https://meta.discourse.org/u/craigconstantine)
#### Post date: [January 3, 2022, 4:26pm UTC](https://meta.discourse.org/t/category-banners/86241/141 "2022-01-03T16:26:20Z")

</div>

Am I stoopid… or is there no way to submit an issue to the Git repo:

[https://github.com/discourse/discourse-category-banners](https://github.com/discourse/discourse-category-banners)

??

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 13, 2022, 7:40pm UTC](https://meta.discourse.org/t/category-banners/86241/142 "2022-01-13T19:40:08Z")

</div>

You do that by posting here with details 🙂

---

<div class="post-metadata">

### Author: ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### Post date: [February 9, 2022, 8:42am UTC](https://meta.discourse.org/t/category-banners/86241/143 "2022-02-09T08:42:20Z")

</div>

> [@Kameron\_Bourgeois](#):
>
> Is there a way to make the category banner also display in posts?

Has this request been resolved by this or any other theme component or method? I am looking for this functionality to give context to users landing on pages of a specific category i.e. through web searches or links shared in social media, and not going through the category main page.

---

<div class="post-metadata">

### Author: ![craigconstantine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/craigconstantine/32/511195_2.png) [@craigconstantine](https://meta.discourse.org/u/craigconstantine)
#### Post date: [February 12, 2022, 3:09pm UTC](https://meta.discourse.org/t/category-banners/86241/144 "2022-02-12T15:09:53Z")

</div>

I have two Discourse-hosted sites where I’ve replaced (via discourse category icons component) the default padlock-icon to be a Font Awesome icon. But, the padlock is still showing in the category banners—not just the one category I’ve shown from each of these sites, but for _all_ of the categories where the icon should appear, I’m still seeing the default padlock-icon.

 ![Screen Shot 2022-02-12 at 10.07.42](https://global.discourse-cdn.com/meta/original/3X/e/0/e0379b7931d978a15b012ecd8ecc8b6fcf530742.png)

 ![Screen Shot 2022-02-12 at 10.08.06](https://global.discourse-cdn.com/meta/original/3X/1/3/13a5a7728375c3ec0147f08b703e5114b9777a9e.png)

---

<div class="post-metadata">

### Author: ![Drew-ART](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Drew-ART](https://meta.discourse.org/u/Drew-ART)
#### Post date: [April 3, 2022, 4:22pm UTC](https://meta.discourse.org/t/category-banners/86241/145 "2022-04-03T16:22:11Z")

</div>

I find a conflict between this and the latest version of Discourse ( 2.9.0.beta3) which occurs when you add an image a category or subcategory.

The plugin pulls the 1st line of text from the ‘about’ post into the banner. When you add an image to a category the latest versions of Discourse pulls the same text into its own header next to the image.

The issue this creates is that every category and sub category has to have an image and the setting ‘show description’ is turned off, or none can have an image as this leads to the description being repeated in the banner and underneath it. So its all or nothing.

 ![image](https://global.discourse-cdn.com/meta/original/3X/4/8/48c20fc12a7304460a66fd9c26d39c8e0e5d7973.png)

I’m not really sure this is actually an issue with this plugin, or if i’m missing a way to turn off the image and description inside the category in Discourse so it doesn’t mess up my Category banners.

---

<div class="post-metadata">

### Author: ![Drew-ART](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Drew-ART](https://meta.discourse.org/u/Drew-ART)
#### Post date: [April 6, 2022, 12:13pm UTC](https://meta.discourse.org/t/category-banners/86241/146 "2022-04-06T12:13:10Z")

</div>

I was able to solve the issue by using a different plugin: [Discourse Category Header theme component](https://github.com/naidihr/discourse-category-headers)

The final result doesn’t look as good as this one unfortunately. I wonder if the options for the other plugin can just be copy/pasted into this one, as the only obvious difference is whether the plugin is targeting the banner or header div. This one has better styling, that one as the ability to turn more options on and off and customise.

---

<div class="post-metadata">

### Author: ![JamesDb](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jamesdb/32/262538_2.png) [@JamesDb](https://meta.discourse.org/u/JamesDb)
#### Post date: [June 23, 2022, 1:27pm UTC](https://meta.discourse.org/t/category-banners/86241/150 "2022-06-23T13:27:01Z")

</div>

What could I add in a custom CSS to reduce the line space between the Category and the Description text?

---

<div class="post-metadata">

### Author: ![keegan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/keegan/32/383395_2.png) [@keegan](https://meta.discourse.org/u/keegan)
#### Post date: [June 23, 2022, 3:14pm UTC](https://meta.discourse.org/t/category-banners/86241/151 "2022-06-23T15:14:24Z")

</div>

```scss
div[class^="category-title-header"] .category-title-contents .category-title {
    margin-bottom: 0;
}

```

---

<div class="post-metadata">

### Author: ![JamesDb](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jamesdb/32/262538_2.png) [@JamesDb](https://meta.discourse.org/u/JamesDb)
#### Post date: [June 23, 2022, 3:23pm UTC](https://meta.discourse.org/t/category-banners/86241/152 "2022-06-23T15:23:37Z")

</div>

Perfect! thankyou for that 🙏

---

<div class="post-metadata">

### Author: ![AquaL1te](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aqual1te/32/201966_2.png) [@AquaL1te](https://meta.discourse.org/u/AquaL1te)
#### Post date: [June 29, 2022, 7:59am UTC](https://meta.discourse.org/t/category-banners/86241/153 "2022-06-29T07:59:47Z")

</div>

Would it be an idea to make these banners clickable? Because now the banner only includes the first line of the “About” topic of a category. Often there is more information in such an “About” topic. By making them clickable it becomes easier to learn more than just that first line. Of course people can create links to the “About” topic as well. But while being in that topic already, you then have a link to itself. That looks like an ugly hack. Just a suggestion 🙂

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [May 3, 2023, 4:53pm UTC](https://meta.discourse.org/t/category-banners/86241/181 "2023-05-03T16:53:19Z")

</div>

I’ve just made an update to this component that makes it integrate with [Tag Banners](https://meta.discourse.org/t/tag-banners/124240)

[https://github.com/discourse/discourse-category-banners/pull/32](https://github.com/discourse/discourse-category-banners/pull/32)

When both components are installed and you’re filtered to a category and a tag, rather than stacking the banners, now the tag name will be shown within the category banner:

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/6/1/661c672287da80fe28b7d629b9517fe098ee440a.png)

---

<div class="post-metadata">

### Author: ![md-misko](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/md-misko/32/126315_2.png) [@md-misko](https://meta.discourse.org/u/md-misko)
#### Post date: [May 3, 2023, 7:54pm UTC](https://meta.discourse.org/t/category-banners/86241/182 "2023-05-03T19:54:47Z")

</div>

> [@awesomerobot](#):
>
> When both components are installed and you’re filtered to a category and a tag, rather than stacking the banners, now the tag name will be shown within the category banner

Thanks Kris, another great integration!

Few issues though:

- it’s not working for me in mobile view (even on desktop browser—no web console errors)
  - category banner displays properly in both desktop and mobile view, but tag banner only displays in desktop view

- when also using with Tag icons component
  - tags have generic tag icon _and_ the icon defined by Tag icons (it would be better if only Tag icons defined icon was displayed in such cases)
  - when icon defined by Tag icons is the same color as Category banner the icon is rendered invisible (similar problem as Category banners + Category icons integration—if possible please allow the Tag icon to match the banner text color for this combo too)
  - Remove hyphens / underscores from Tag banners completely hides the icon defined in Tag icons

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [May 3, 2023, 8:58pm UTC](https://meta.discourse.org/t/category-banners/86241/183 "2023-05-03T20:58:47Z")

</div>

Thanks for the quick feedback!

I’ve added a fix for the tag not appearing in mobile view:

[https://github.com/discourse/discourse-tag-banners/commit/8fa15f8c4a4be3697ee2fd903ba6311683477b2d](https://github.com/discourse/discourse-tag-banners/commit/8fa15f8c4a4be3697ee2fd903ba6311683477b2d)

I’ve also added a setting to disable the tag icon for now, which is a temporary solution for working better with the tag icons component. I’ll have to spend a little more time getting a proper integration with the tag icons component working.

---

<div class="post-metadata">

### Author: ![md-misko](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/md-misko/32/126315_2.png) [@md-misko](https://meta.discourse.org/u/md-misko)
#### Post date: [May 4, 2023, 5:02am UTC](https://meta.discourse.org/t/category-banners/86241/184 "2023-05-04T05:02:10Z")

</div>

Thanks for a quick workaround, meanwhile I’ve got another one for you 😉:

when using Category banners together with Tag banners with Remove hyphens / underscores set to true, the tag name (eg. `with-hyphens` is displayed without hyphens under the title and hyperlinked but the link is invalid (`/tag/with hyphens`) and results in 404.

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [May 9, 2023, 10:07pm UTC](https://meta.discourse.org/t/category-banners/86241/185 "2023-05-09T22:07:03Z")

</div>

Oh another good one, thanks again!

This fix relies on a minor Discourse update: [DEV: add optional `displayName` parameter for `discourse-tag` by awesomerobot · Pull Request #21391 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/21391)

[https://github.com/discourse/discourse-tag-banners/pull/11](https://github.com/discourse/discourse-tag-banners/pull/11)

So once Discourse and the component are updated, tags without hyphens or underscores will be linked correctly.

---

<div class="post-metadata">

### Author: ![packman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/packman/32/289322_2.png) [@packman](https://meta.discourse.org/u/packman)
#### Post date: [August 24, 2023, 1:13pm UTC](https://meta.discourse.org/t/category-banners/86241/187 "2023-08-24T13:13:37Z")

</div>

I’ve successfully added banners to some of my categories but can’t add them to others.

The categories it doesn’t work for have names like “Weather - General”, i.e. Space-Hyphen-Space in the middle of the name. If I change the name to “Weather-General”, i.e. no spaces around the hyphen the banner is displayed as expected. In both cases the slug for the category is the same - “weather-general” so I’m not sure why that’s not accepted as a valid value in one case but is in the other.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [March 8, 2024, 7:50am UTC](https://meta.discourse.org/t/category-banners/86241/188 "2024-03-08T07:50:07Z")

</div>

15 posts were split to a new topic: [Can I align the category banner away from the sidebar?](https://meta.discourse.org/t/can-i-align-the-category-banner-away-from-the-sidebar/298486)

[Previous page](https://meta.discourse.org/t/category-banners/86241.md?page=1)

[Next page](https://meta.discourse.org/t/category-banners/86241.md?page=3)
