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: GitHub - jrgong420/discourse-topic-cards: This changed the topic list into cards with a modified layout, and a thumbnail if available.

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