Category Banners

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.

3 Likes

Hi, and thank you for this very useful component!

Unfortunately, I am having trouble with the banners not consistently being displayed. When navigating to a category from withing Discourse, banners won’t show. When I hard reload a category page, the banner will show. I have cleared my browser cache etc. but can’t resolve the issue. Any ideas what I might be missing?

3 Likes

Can you make banners for Tag?

1 Like

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

??

1 Like

You do that by posting here with details :slight_smile:

1 Like

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.

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.

1 Like

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.

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.

1 Like

I was able to solve the issue by using a different plugin: Discourse Category Header theme component

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.

1 Like

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

1 Like
div[class^="category-title-header"] .category-title-contents .category-title {
    margin-bottom: 0;
}
2 Likes

Perfect! thankyou for that :pray:

2 Likes

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 :slight_smile:

2 Likes

I’m using the Category Banners theme and love how desktop users can see both the categories and the latest topics across all of the categories that they’re a part of. It’s a great way to see what’s going on at a glance. I wish the mobile view had similar. Ours only shows the categories. I’d really love it to show the latest 10 topics also. Ideally it would show those on top of the categories as that’s most likely why they’re there.

Is there any good way to accomplish this? I’m concerned that even if I could figure out how to adjust the out that way, the next update would come along and wipe it all out.

Thanks again for a great theme.

2 Likes

This is a bit out of scope for this topic, which just covers the category banner theme component.

I think you’re referencing the /categories page on mobile, which doesn’t have the same variety of template options as desktop. Personally, I’d like to get all of our /categories page options available on mobile in one way or another, but that’s not a priority at the moment.

In the meantime it is possible to make changes to that component in a theme (various techniques are covered in Developer’s guide to Discourse Themes). Discourse updates might require themes to undergo some maintenance, but they shouldn’t wipe everything out completely.

1 Like

I’m referring to the home page on a mobile view. It doesn’t show the latest posts like it does on a desktop. My preference would be to have it show the latest 10-20 posts and then show the categories beneath it. Currently it just shows the categories.

2 Likes

Is this category banner exclusive to a banner topic? Can they show up at the same time?

1 Like

Hi! Small question - sorry if it has been tackled before. Is this component will be updated to support the experimental sidebar? For the moment, it seems only to allow to be displayed on top of both sidebar/content, while the Welcome banner allows being only displayed on top of content.

Have a great day!

4 Likes

I agree with this comment! I’d like the category banners to now display only on top of the content instead of the sidebar as well.

2 Likes

Is it possible to remove the description for the subcategory banners?

In the example below, only “Clinical Leads” would be visible. I could use display:none, but the data is still loading. Thank you.

1 Like