Discourse Category Banners

I just wanna say FANTASTIC addition. Im not using the theme component yet but using the code. Im also using the background images instead of the colors (I just took out the bg color style in the js (i knew that much, hahaha)

OP rocks. I 2 themes and this is one of em. (forums before that used a similar banner layout. I think alot of forums or sites use the banner layout anyway so it is kind of welcoming I think :slight_smile:

2 Likes

thanks for this wonderful theme :heart:, it helps users to note the category description much easier.

currently if there’s a link or a bold/italic word in the category description, in the banner it’ll appear as simple text (e.x. p style instead of a style). isn’t it better if the text style is preserved in the banner as well?

2 Likes

Could you make banners for tags?

5 Likes

Thank u very much. :yum:

Is there any way to enable the banner on the home page of the forum as well?

4 Likes

You need a different theme component for that. See Banner themes (and instructions for customizing them)

2 Likes

@awesomerobot Is there a way to make the category banner also display in posts? Thanks!

Hi, I absolutely love this component! Thanks for your work!

I’m wondering, how can I style the background so that it automatically pulls the category background image and makes it the background of the banner. The backgrounds are already hidden anyways, so I want it to simply display as the background to the banner, rather than the page. I’ve tried this, but it didn’t work and I think I might be targeting the wrong variable:

return h('div.category-title-header' + " ." + category.slug, {
                    "attributes" : {
                        "style" : "background-color: #" + category.color + "; color: #" + category.text_color + "; background-image: url(\'" + 
                        category.background_url + "\');"
                    }
                }

Also, I’m wondering, how can I make the banner thinner for a fixed width design. When I attempted, it continued to be left-justified.

@awesomerobot Is there a simple solution to make the category banner also display for posts under the category?

Hi There!

is it possible to add a custom background image instead of the space where the color shows?

Is then possible? To add the logo of the category next to the category title? thx!

Is it possible to set a banner for the uncategorized category?
Is it possible to set a banner for the categories page?

I want there to be a banner on these pages that displays a description (like the others do).

Any info on how to do that would be a huge help.

Thanks.

It isn’t currently possible… but those seem like good reasonable requests… it will take some extra work because

  1. The Uncategorized description is stored differently, because it’s not a “real” category

  2. I’d have to add the ability to pull in a description from somewhere else for the Categories page, because it doesn’t have a description or anywhere to store one

I can look more closely at adding these options at some point (not sure when, unfortunately)… you’ll just have to keep an eye on this topic for updates.

4 Likes

My recommendation would be to turn off uncategorized and create a real category.

1 Like

What im aiming for is a banner on every page, not just categories. It looks rather strange from a design point of view to have it only appear on some screens. Just the title of the page would be enough - no need for a description if there isn’t one.

I guess the only way to do this would be to clone the component and set it up to run on all pages?

Oh right, that’s a bit different… so you’d also want topics to have titles in the same banner style too?

3 Likes

I didn’t consider that, but actually that would look quite nice from a theming point of view. I’m looking at it from the end users point of view - they probably don’t know the difference between a category, topic, home page etc…

My goal is to create a consistent UX. I set the banner to be transparent and use the background as the banner itself… In future I’m looking to change the page background as a way to define the category instead.

Here’s what it currently looks like (and how I ideally want every page to look) :slight_smile:

Without a banner for every page though, it looks inconsistent with the main overflow moved up the page (actually off the screen which is how the default discourse theme does it which I don’t want).

2 Likes

I think it’s great that the category banners now render the content in HTML

Is there any way to display emoji’s there? In my case I added three important links: Anfänger - Cannabisanbauen.net Forum

I want to display the emojis next to each link as well. The original about topic is here: Über die Kategorie Anfänger - Anfänger - Cannabisanbauen.net Forum

1 Like

Is it possible to get this to fire on tag-pages too?

3 Likes

I’ve built a similar component for tag banners

Unfortunately tags don’t have descriptions or colors, so it’s less feature-rich at the moment.

10 Likes

@danyalamriben @syl Kris has made tag banners which we can explore using in the platform. Thanks Kris, this is awesome.

2 Likes