Topic Cards

You can create a new component and add that to your theme

2 Likes

Hey guys

I forked the TC and played a bit around to add a few more features:

  • Placeholder when no thumbnail
  • Choose between grid and list style for desktop/mobile
  • More granular dimension control
  • More granular border radius control

You can find details in the repo: https://github.com/jrgong420/discourse-topic-cards/

:warning: Disclosure: The fork was planned, implemented, and tested with the help of AI coding tools. Use at your own risk.

1 Like

Do you have a couple of SS to demo the list & Grid with maybe some of your other additions?

Hey guys and @Heliosurge

In the meantime we did an extensive rework and extension of the theme component with tons of new features, a full refactoring of all components and extensive restructuring.

In addition we also added a few new features. Check it out here:

3 Likes

So when Show for suggested topics is enabled - it doesn’t seem to play nicely with the headers when using related topics too.

Please create a setting for mobile card max height.

Would it be possible to add the Bulk Actions back while the topic cards component is in use? I’ve unhidden it with some CSS tweaks for my forum but the UX on it isn’t great :sweat_smile: Might be better if it was included by default within the component.

Oh and as I’m typing this I have scrolled up and this has already been requested. Any idea on whether it could be implemented?

This is the CSS I used to make it at least useable if not very pretty:

.topic-cards-list .topic-list-header {
  display: block;

  .topic-list-data.posters,
  .topic-list-data.posts,
  .topic-list-data.views,
  .topic-list-data.activity {
    display: none;
  }

  .topic-list-data.default > span:not([class]) {
    display: none; // removes the stray 'Topic' text that has no span class to target
  }
}

.topic-list-body {
  tr.bulk-selecting.topic-card {
    gap: 0; // removes huge spacing between the checkbox and the rest of the topic card
  }
}

Thanks for this component. It is doing a lot of work on our site and we
appreciate it.

One request. We run a community where members use their real names, so we
have set prioritize username in ux to off and display name on posts to on.
Full names now show correctly on posts, user cards and profiles. The one
place that still shows the @username is the author on the topic cards.

Would it be possible to add a setting so the card author respects the site’s
name display settings, showing the member’s full name and falling back to the
username where no name is set?

Happy to test any change on our instance and report back. Thanks again for
building and maintaining it.

2 Likes

Sure can! we should ideally support this in most places usernames appear, I’ve just added the feature here: FEATURE: support prioritizing real names - Pull Request #84 - discourse/discourse-topic-cards - GitHub — so you should start seeing real names after you update the component.

5 Likes

That’s awesome Kris, thank you. Bronwyn

2 Likes