# Topic Banners component

**URL:** https://meta.discourse.org/t/topic-banners-component/216229
**Category:** Theme component
**Tags:** deprecated
**Created:** [January 27, 2022, 5:08pm UTC](https://meta.discourse.org/t/topic-banners-component/216229 "2022-01-27T17:08:00Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [January 27, 2022, 5:08pm UTC](https://meta.discourse.org/t/topic-banners-component/216229/1 "2022-01-27T17:08:00Z")

</div>

This component lets you render any topic as a banner on custom url paths.

The default look is pretty basic. The screenshot shows the default Welcome topic as a banner on the Latest list:

 ![Screenshot from 2022-01-27 14-42-15](https://global.discourse-cdn.com/meta/original/3X/0/5/05d84c6bca48bd6f28df71c22012861a5b101d89.png)

But banners will render various content that is supported on topics, e.g. emojis, animations, video links.. So you could use (and abuse) this in many ways 🙈

In Settings, you select views by their relative url and topics by their id. You can also position the banners on one of three different plugin-outlets and only show them to a specific group:

 ![Screenshot from 2022-01-27 15-41-37](https://global.discourse-cdn.com/meta/original/3X/2/4/2411351640cef316d557816abd9b50010b2a85c7.png)

> 👍 **Credits:** The widget code for this component is essentially a copy of the [Category Sidebars component](https://meta.discourse.org/t/discourse-category-sidebars/107561) by @awesomerobot and, as I take it, @xrav3nz

| | | |
| --- | --- | --- |
| 🛠 | **Repository** | [GitHub - nolosb/discourse-topic-banners: A Discourse theme component. Renders any topic as a banner on custom url paths. · GitHub](https://github.com/nolosb/discourse-topic-banners.git) |
| ❓ | **Install Guide** | [How to install a theme or theme component](https://meta.discourse.org/t/how-do-i-install-a-theme-or-theme-component/63682) |

Install Theme Component

---

<div class="post-metadata">

### Author: ![Paracelsus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/paracelsus/32/164912_2.png) [@Paracelsus](https://meta.discourse.org/u/Paracelsus)
#### Post date: [January 27, 2022, 6:53pm UTC](https://meta.discourse.org/t/topic-banners-component/216229/2 "2022-01-27T18:53:09Z")

</div>

> [@manuel](#):
>
> But banners will render any content that is supported on topics, e.g. emojis, animations, video links… So you could use (and abuse) this in many ways

Does this include polls (which you can interact with)? (it’s been something we miss a lot, to put a poll visible to everyone instead of hidden somewhere in a post)

---

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [January 27, 2022, 7:24pm UTC](https://meta.discourse.org/t/topic-banners-component/216229/3 "2022-01-27T19:24:56Z")

</div>

Good question! But no, just tried it out:

 ![Screenshot from 2022-01-27 19-20-24](https://global.discourse-cdn.com/meta/original/3X/e/c/ec30a4e0e52a02b17c78ad2f90b2cb154acf01b8.png)

The poll would show as on the composer preview. You can’t interact and it also doesn’t show results.

---

<div class="post-metadata">

### Author: ![GreenOWL](https://avatars.discourse-cdn.com/v4/letter/g/a9a28c/32.png) [@GreenOWL](https://meta.discourse.org/u/GreenOWL)
#### Post date: [March 10, 2022, 8:52am UTC](https://meta.discourse.org/t/topic-banners-component/216229/4 "2022-03-10T08:52:15Z")

</div>

I found a bug in this component, when it is enabled and configured to show the topic of only a specific group.

If the guest or users attend the forum not from this group, the pages update works incorrect, the other topics are not load after page refresh in browser.

Console:

```plaintext
Uncaught TypeError: Cannot read properties of null (reading 'groups')
    at n.html (68eb2e30e7629f8db22df6fed8efb777b0183d8d.js?__ws=mydomain.com:114:36)
    at n.value (application-8b970b30b88888346a1f4d53543a21332202376215babe59aa315ac2054a2627.js:sourcemap:1:3239172)
    at n.value (application-8b970b30b88888346a1f4d53543a21332202376215babe59aa315ac2054a2627.js:sourcemap:1:3235241)
    at s (_vendor-0cf07f050f530b08ccc553a048b7cccd4edb486adc39b865c07d6c6c1cc57fbf.js:90601:45)
    at t.exports (_vendor-0cf07f050f530b08ccc553a048b7cccd4edb486adc39b865c07d6c6c1cc57fbf.js:90584:21)
    at m (_vendor-0cf07f050f530b08ccc553a048b7cccd4edb486adc39b865c07d6c6c1cc57fbf.js:90988:17)
    at h (_vendor-0cf07f050f530b08ccc553a048b7cccd4edb486adc39b865c07d6c6c1cc57fbf.js:90856:9)
    at d (_vendor-0cf07f050f530b08ccc553a048b7cccd4edb486adc39b865c07d6c6c1cc57fbf.js:90843:5)
    at n.rerenderWidget (application-8b970b30b88888346a1f4d53543a21332202376215babe59aa315ac2054a2627.js:sourcemap:1:1455271)
    at t.invoke (_vendor-0cf07f050f530b08ccc553a048b7cccd4edb486adc39b865c07d6c6c1cc57fbf.js:66550:16)
    at e.t.flush (_vendor-0cf07f050f530b08ccc553a048b7cccd4edb486adc39b865c07d6c6c1cc57fbf.js:66442:13)
    at e.t.flush (_vendor-0cf07f050f530b08ccc553a048b7cccd4edb486adc39b865c07d6c6c1cc57fbf.js:66646:21)
    at e.n._end (_vendor-0cf07f050f530b08ccc553a048b7cccd4edb486adc39b865c07d6c6c1cc57fbf.js:67222:34)
    at e.n.end (_vendor-0cf07f050f530b08ccc553a048b7cccd4edb486adc39b865c07d6c6c1cc57fbf.js:66908:12)
    at e.n._run (_vendor-0cf07f050f530b08ccc553a048b7cccd4edb486adc39b865c07d6c6c1cc57fbf.js:67277:16)
    at e.n._join (_vendor-0cf07f050f530b08ccc553a048b7cccd4edb486adc39b865c07d6c6c1cc57fbf.js:67251:21)
    at e.n.join (_vendor-0cf07f050f530b08ccc553a048b7cccd4edb486adc39b865c07d6c6c1cc57fbf.js:66968:19)
    at h (_vendor-0cf07f050f530b08ccc553a048b7cccd4edb486adc39b865c07d6c6c1cc57fbf.js:53760:28)
    at HTMLDocument.<anonymous> (_vendor-0cf07f050f530b08ccc553a048b7cccd4edb486adc39b865c07d6c6c1cc57fbf.js:53864:19)
    at l (_vendor-0cf07f050f530b08ccc553a048b7cccd4edb486adc39b865c07d6c6c1cc57fbf.js:3776:29)
    at c (_vendor-0cf07f050f530b08ccc553a048b7cccd4edb486adc39b865c07d6c6c1cc57fbf.js:3844:12)

```

---

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [March 12, 2022, 7:01pm UTC](https://meta.discourse.org/t/topic-banners-component/216229/5 "2022-03-12T19:01:57Z")

</div>

> [@GreenOWL](#):
>
> If the guest or users attend the forum not from this group, the pages update works incorrect, the other topics are not load after page refresh in browser.

Thanks for posting this! I could only replicate an error when no user is logged in and I added a fix for that. Could you update the component and try again?

---

<div class="post-metadata">

### Author: ![GreenOWL](https://avatars.discourse-cdn.com/v4/letter/g/a9a28c/32.png) [@GreenOWL](https://meta.discourse.org/u/GreenOWL)
#### Post date: [March 12, 2022, 10:16pm UTC](https://meta.discourse.org/t/topic-banners-component/216229/6 "2022-03-12T22:16:58Z")

</div>

Yes, now it’s work! Thank you! ❤

---

<div class="post-metadata">

### Author: ![anderer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/anderer/32/310458_2.png) [@anderer](https://meta.discourse.org/u/anderer)
#### Post date: [June 10, 2023, 12:56pm UTC](https://meta.discourse.org/t/topic-banners-component/216229/7 "2023-06-10T12:56:17Z")

</div>

ohh, this is awesome! great theme-component as it allows a nice individualisation of each category which seems far superior to the category banner theme component of official - but i might be mistaken

in that sense it might be good to add category banner to the title of the post.

on top this component even can serve the homepage

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [June 10, 2023, 2:29pm UTC](https://meta.discourse.org/t/topic-banners-component/216229/8 "2023-06-10T14:29:00Z")

</div>

Hi there, thanks for sharing!

There is no plans to add close button over the banners?

---

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [June 12, 2023, 9:27am UTC](https://meta.discourse.org/t/topic-banners-component/216229/9 "2023-06-12T09:27:42Z")

</div>

> [@anderer](#):
>
> a nice individualisation of each category which seems far superior to the category banner theme component of official - but i might be mistaken

I’m not sure the component is a good replacement for category banners. Some caveats:

- it will load much slower
- it will not hold dynamic content. E.g. when you change the category name, it won’t update on the component
- it’s also more complicated to set up

That being said, I’d be curious to see how you use it that way 🙂

> [@satonotdead](#):
>
> There is no plans to add close button over the banners?

I only have on use case for this component myself right now, that is serving an expanded intro topic in one community. No plans to add to the component right now.

---

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [January 24, 2024, 1:02pm UTC](https://meta.discourse.org/t/topic-banners-component/216229/10 "2024-01-24T13:02:25Z")

</div>

@manuel Digging out this one, testing on 3.1.4 currently.  
But the " show to group" setting is not working when I add a specific group. Tried case sensitive, but the banner topic is not displayed. When the setting is empty, then it works. Any idea?

---

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [January 24, 2024, 1:26pm UTC](https://meta.discourse.org/t/topic-banners-component/216229/11 "2024-01-24T13:26:37Z")

</div>

Oh yeah, the component will need some re-factoring.. There’s quite some code and I don’t even have a use case myself any longer. Could we tag this as _un-maintained_?

@jrgong don’t know what you are trying to set up, but you could probably try this [Announcement Bar component](https://meta.discourse.org/t/announcement-bar/286352)? It’s styled for a bar layout by default, but with a bit of css and putting it on the _above-main-container_ outlet it can be very similar. Needs html instead of markdown. No group features either, but big advantage is it’s disposable.

---

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [January 24, 2024, 1:55pm UTC](https://meta.discourse.org/t/topic-banners-component/216229/12 "2024-01-24T13:55:15Z")

</div>

@manuel thx for the tip. We will check it out once stable 3.2 is out. the Announcement bar tc is not compatible with 3.1

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [January 24, 2024, 2:22pm UTC](https://meta.discourse.org/t/topic-banners-component/216229/13 "2024-01-24T14:22:36Z")

</div>

> [@manuel](#):
>
> Could we tag this as _un-maintained_?

I’ve applied the tag 👍
