Topic Cards


Currently, the homepage is displaying incorrectly on the Samsung S23 Ultra. A single post is causing text to overflow and break the entire layout.

Is this issue caused by the post itself or a theme component bug?

Thank you!

1 Like

I have checked and found that the issue is caused by a Google Maps link in the post.

If the link is in the format maps.google.com, it works fine.

2 Likes

Is the Topic Cards component getting ready for Upcoming topic-list changes - how to prepare themes and plugins? I just upgraded discourse and got a notice for admins saying that this component needs to be updated.

It has already been updated, so you shouldn’t be seeing any warnings. Can you double check that you’re running the latest official version of this component, and not a fork?

1 Like

Argh, true! My bad. I had forgotten that we are running GitHub - communiteq/discourse-topic-cards: This changed the topic list into cards with a modified layout, and a thumbnail if available.. https://github.com/communiteq/discourse-topic-cards

@RGJ sorry to bother you, do you know if what’s the difference currently between your fork and the main repo?

2 Likes

Yes, the main repo has been properly maintained
 I will get to this in the beginning of next week.

2 Likes

Mobile version for some reason are broken when component ‘topic excerpt’ are enabled and without it too ( i’ve two themes with and without this component and both broke) ¯\_(ツ)_/¯ so this css it’s enough

PS: Paste this code at mobile scss from admin dashboard

.topic-card__excerpt-text {
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
    white-space: normal !important; 
}

.topic-card__excerpt {
    max-width: 100% !important;
    overflow: hidden !important;
}

.topic-list-item {
    overflow: hidden !important;
    max-width: 100% !important;
    white-space: normal !important;
}

td {
    max-width: 100% !important;
    overflow: hidden !important;
    white-space: normal !important;
}

2 Likes

How can this be applied to only a single category, or list of categories, like Topic Thumbnails?

1 Like

You’d need to add the logic to the component. If that’s not on the official roadmap, then only by forking it.

Yes, this is something we would definitely need, as well. @jordan-violet did you do what @nolo suggested


I don’t have the technical know-how to do this. :disappointed_face:

1 Like

We went a different direction that we liked more. We’re using Topic List Thumbnails and then we added some of our own CSS to have it look/behave the way we wanted. You can see it in action here:

5 Likes

Looks good

1 Like

Hey, that means a lot coming from you! Thanks!

1 Like

Any idea why some titles are black while others are blue? All 3 topics are read by me.

Ha! Answered my own question right after posting. Black denotes unread replies. But since the # bubble is right there, it probably doesn’t need the color call out as well.

1 Like

If I want the topic cards themselves to have a different color than the rest of the background, what CSS would I alter?

Also, I don’t see it mentioned, but Topic Cards hides the bulk actions icon, can we unhide that?
I have to keep turning it off any time I need to apply bulk updates to topics.

1 Like

right click on the element you wish to change and pick inspect. the browser devtools will open and you should see the css selector

1 Like

Thanks, I added:

.topic-card.has-max-height {
    background: #e6ecf2
}
.topic-card.has-max-height:hover {
    background: #ddecf7
}

And it works perfectly with stock ‘Shades of Blue’ palette.

Alright, part 2. How do I edit it to work with 2 color palettes? Looked good till the browser switched to dark mode.

Answering my own question again


I learned about @media (prefers-color-scheme: light/dark) last night, so all good.

1 Like

Thank you so much @eisammy!!!
I’ve been having issues with this and have been pulling my hair out!
For some reason, I can’t get any external links to onebox, so the long link in the excerpts effectively stretched the text out of the box and ruined the UI of my site. With your help, it’s resolved!

1 Like