Discourse Category Headers theme component

Is there a way to show the entire contents of the “About the XXX category” page in the category banner/header description? Currently, only the first paragraph shows, but we would like to show more text than that, as well as images in the category header/banner. Is there a way to do this? Thanks in advance for your help.

1 Like

@ Rhidian

Your plugin is fantastic, but if we could just display the entire contents of the “About” page instead of just the first paragraph, that would help us immensely.

I’ve looked through the code, and I see the following catDesc() function, but it looks like category.description is just the first paragraph. How can we get the full contents of the About page?

              function catDesc() {
                  if(settings.show_category_description) {
                      return h('div.cooked', {innerHTML: category.description});
                  }

Any feedback would be much appreciated. Thanks in advance!

The first paragraph of the default About topic in each category has a special status in Discourse. It is used to display a short summary of the category. This is used in the category lists and in the default Discourse category header. It is stored separately in the database structure - in the metadata for the category.

This theme component makes use of that built in functionality and adds various enhancements to default category header functionality to display the metadata such as the category name and logo, and some positioning and style options. It is limited by those metadata however and unfortunately the whole of the About messsge is not one of them, due to the way the data are structured in Discourse.

I can see why it has been built that way as the purpose is to display a short text summary.

1 Like

Regarding the category link colour/style:

The name of the category displayed in the banner serves as a link. This is useful when displaying a subcategory - as this is shown as Parent category name: Subcategory name. Clicking on the parent category name then serves as a breadcrumb link to take you up to that parent category page.

The styling of that link was done so that it displays in the same colour as the rest of the title. This makes the breadcrumb link less obvious but it looks better in my view.

Please feel free to change that in your install by commenting out/removing the a: styling you’ve highlighted.

I note others have commented on wanting to have any links they have included in the first paragraph of the about message to display in the category header. If that’s useful I may add a class to the header so the ‘same colour’ styling will only apply to the breadcrumb links, if that would help?

2 Likes

That would.be very helpful.

We make extensive use of links in that first category description paragraph, and can’t use this awesome component at the mo because of it.

I have made that change. The links should now display by default in the category descriptions using the standard theme color setting for links.

@nathankershaw please can you confirm that works for you now? You will need to update the component.

I’ll have to install it first! The link thing was a strong reason that I have put it off. I’ll install it and have a play shortly.

Thanks for this amazing theme, I’m having a bit of trouble with the menu overlapping the theme box at the top of the page. Has anyone seen this / know how to fix it?

Is your forum public. Happy to take a look if you can provide a URL?
Are you using the latest version?

1 Like

Hi Rhidian, thanks, I’ve actually decided to change the layout so its not an issue anymore. If no one else has seen this then it must be something particular to my forum.

2 Likes

Hey! Lovely theme here! Thanks for this :slight_smile:

Also, I am having a little trouble trying to replicate the look you have shared in your screenshot here : image

This is what I am getting on a category page that has two sub-categories :

And yes I have already turned on the box style as mentioned here :

For reference, this is how my categories page looks like :

Would be really nice if you could help me figure this out :slight_smile:

Hi, the subcategories showing as boxes is the native discourse boxes. It’s not part of the theme component.

Do this standard discourse boxes work in any category with subcategories?

In order to activate this for subcategories, you need to edit the settings in each Parent category like this:
image

3 Likes