Discourse Category Headers theme component

Nice! It is back to tip-top shape. Thanks for being so amazingly responsive, and throwing an improvement in there as part of the bargain! How it now looks:

1 like

Hallo Nathan, ik ben benieuwd, zou het beter zijn als de link ‘Lees meer’ uitgelijnd was met de beschrijving, of er inline aan het einde van stond?

I think that it would be best inline at the end of the text.

This would be much more compact / efficient, and more consistent with pinned posts (I think):

1 like

@nathank I have added this feature!

This PR adds 2 new features:

  1. More paragraphs to the category description. This adds a new setting, show_full_category_description (default false) to show the full post contents of the About category topic.
  2. Inline ‘Read more’ link. This adds a new setting inline_read_more (default false) to append the ‘Read more’ link at the end of the category description, instead of a few lines down.

Things to note:

  • The inline ‘Read more’ link is not added to the end of the category description when show_full_category_description is true
  • There is no override regarding the category descriptions: you can set both show_category_description and show_full_category_description to true, and both descriptions will be shown. This may be addressed in a later PR.

Please post back here if you face any issues.

4 likes

Heeft iemand anders problemen met 3.5.0 waarbij categorie-logo’s en emoji’s niet worden weergegeven? Zelfs wanneer het categorie-vergrendelingspictogram is ingeschakeld, wordt het ook niet weergegeven.

Hi there, could you send screenshots of this, as well as any browser errors if any? This may have to do with version compatibility :thinking:.

You can see it live in action here: Hanfgarten-Contest - Forum | Cannabisanbauen.net
(I tested with tc preview only, exact same behavior…)

1 like

Do you mean category logo, as the one you upload in the images section of the category settings, or do you mean the style you configure in the general settings where you can choose square, icon, or emoji?

Okay, do you have:

  • show_site_logo ticked?
  • logo_small site setting?

The lock icon situation is interesting. I’m taking a look.

EDIT: @jrgong I’ve just merged a PR. Thing is, you’re on stable and I don’t think you’ll get the update :thinking:… is the recent widget deprecations also on stable?

I think updating should work. There is no entry in the compatibility file that pins the current stable to an older version.

I sometimes add one when I change something and I don’t want to check if the changes also work on older versions like stable.

1 like

Below are my settings:

I updated the TC but the issue persists

Hebben een van uw categorieën geen categorie-logo? Als dat zo is, helpt het aanvinken van show_site_logo dan?

that is the case

Unfortunately not

1 like

Werkt het als je een PNG-afbeelding gebruikt in plaats van een SVG?

In light mode yes. but in dark mode the category header still displays the light logo. see here in action.

my category image settings:

Ik ben er niet zeker van of compatibiliteit met Dark Mode Categorie Logo’s al is ingebouwd - dit zou een functieaanvraag zijn.

Mag ik voorstellen om een financiële bijdrage te overwegen aan @NateDhaliwal (of deze ten minste aan te bieden) om dit op te pakken?

1 like

Yes, as Nathan said, the component currently does not use the dark mode image. However, I do see an interesting component:
https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/components/light-dark-img.gjs

I’ll have to test a few things to see if it can work.

2 likes

I’ve noticed a regression - the category description text isn’t refreshing when navigating between categories.

The icons and title refresh, but not the text for some reason. It is fixed with a page refresh:

1 like

gulp I will look into this, thanks for the report.

1 like

Looking into it a bit more, my other site with the TC is fine in this regard. Don’t waste your time looking at it until I’ve dug a bit deeper!

1 like