[ARCHIVE] Topic List Previews

(Angus McLeod) #851

Yeah, it’s a bit nested. You need to use :

.tlp-featured-topics.has-topics .topics {
  .tlp-featured-topic.show-details .featured-details .content a,
  .tlp-featured-topic.show-details .featured-details .content {
    color: #CCBADC;


(David Kingham) #852

Thank you Angus, that works great. One more thing I am trying to do is to hide the excerpt, which I have halfway achieved with the css below, but there is a transition from the hover to not hover state where the excerpt shows up briefly, any ideas?

.tlp-featured-topics.has-topics .topics {
  .tlp-featured-topic.show-details .featured-details .content a,
  .tlp-featured-topic.show-details .featured-details .excerpt {
    display: none;

(Ryan Gennrich) #853

Is there a way to have the corners of the top list thumbnail rounded with a slight border added? It would look much nicer this way.

(Angus McLeod) #854

I’ve added a site setting to toggle the topic excerpt on featured images: topic list featured excerpt. Default is enabled.

Yup, you can add your own CSS to the default theme on your site. For example:

.topic-thumbnail img {
  border: 1px solid #e9e9e9;
  border-radius: 4px;


Angus, really enjoying the plug-in, thanks. It adds a lot to the forum i’m using it on.

Sorry to be a pain, but:

  • is there any way to hide the featured images ‘bar’ when drilled into a Topic to give the Topic a little more real-estate?
  • a UI based way to rebake the order, or a setting to force it to be based on chronology would be nice.

btw, Love the use tags to determine the choice! An inspired decision to leverage that functionality!

Thank you!

(Nigrin D Jay) #856

Hi Angus!

The plugin is automatically disabling, what could be happening?


Hi Angus,
Great job on this plugin… very useful on my forum.
Just say u know I Would love to have them display on suggested topic list.
Once again great job👍🏻

(Angus McLeod) #858

You can enable the various TLP settings for suggested lists using the suggested and suggested-mobile items in the relevant setting lists.

(Angus McLeod) #859

Thank you, but I can’t take credit. @bartv suggested it :slight_smile:

I’m not sure what you mean here. You have topic list featured images topic enabled, but you want to reduce the size of the featured image section in certain scenarios?

Sure we can add an order setting, but just so I’m clear, is your preferred order when the post containing the image was posted (descending)? Currently the order is when the featured tag was applied, i.e.

  SELECT created_at FROM topic_tags
  WHERE topic_id = topics.id
  AND tag_id = #{tag_id})


thanks to both of you then!

ie once I click into a particular Topic, the featured images disappear … they only show in the Topic List view.

In a perfect world, we’d somehow have the option of:

  • order by when tagged (no problem if this is default), although most recently tagged should be first on the left?
  • be able to re-order by Topic age, so newest Topic’s image first on left and so on.

Out of interest if I remove all the tags then re-add them, will it ‘rebake’ the order? That would tie me over (perhaps I should try it rather than asking!)


One more thing, a minor bug:

I’ve noticed if you have an @username in your excerpt text it leaves a grey bubble on your featured image that doesn’t disappear when you move mouse away.

This bug goes away if topic list featured excerpt is off

(Angus McLeod) #862

Is the setting topic list featured images topic enabled?

If it’s disabled, featured images will not appear above topics. e.g: Topic List Previews - Angus’ Sandbox

I’ve added a setting to let you order by tag application or topic creation (topic list featured order): Add featured images order setting · angusmcleod/discourse-topic-previews@ed217d0 · GitHub

Yup. The order is determined when the list is generated (when the route is loaded), based on the created_at field of the relevant object. If you remove tags and re-add them this will create new records in topic_tags and hence new created_at times.



Yes it was! And disabling it makes it behave the way I would like it to, great!

Sorry for mis-communication, I had misunderstood and misunderstood the effect of the setting too (thought this had a global effect, even on the Topic List view)

That was quick! Thank you. Tested and confirmed.

Wow, that’s perfect! Changed the setting to Topic and looks right to me. Thanks Angus! For completeness at some point you could add ‘Post’ option as well to order by latest posting? … but I’m being picky now and you must be busy! … Topic is a good option for me

(Bart) #864

Hey Angus!

Just a quick thing I noticed - the featured bar doesn’t seem to be using the fallback image that we have defined for the topic list previews:

PS: We have a very cool extension to Topic List Previews coming up shortly :slight_smile:


Sorry to keep posting, but I think i’ve found another bug, perhaps this is a known issue?:

The featured image list appears to ignore security? I logged out and it was still showing a preview of a Topic I should not see as a logged out user. On clicking on it of course I was denied access, but it was still showing an excerpt which might be tricky depending on the content …

(Angus McLeod) #866

I’ve set the site default thumbnail as the featured image fallback

@merefield Indeed. There is a check, but it wasn’t operative. Fixed.


Yep, now working for me, thanks again Angus!

(I will review your fixes as a learning exercise! ;))

(Bart) #868

Hey Angus,

when you enter two tags in the ‘topic list featured images tag’ field, it completely breaks the featured bar.

It would be useful to be able to enter more than one tag here: I’m considering mixing featured artwork with sponsored/promoted content. IF you’d be willing to support that, it would also be really useful to add the specific tag as a class to the items so I can create a visual distinction between the two types of content.


SEEEHi @angus it will be great to remove d word ‘like/likes’ in ur topic list preview leaving leaving just d number of likes and d heart shape like dis:

Same for views/view leaving d number of views and ‘eye’ shape.
Also ‘2 hours ago’ can just b ‘2h’, and 2d and 2y for days and years respectively.

(Bart) #870

@angus I suspect that TLP may be loading thumbnail images on topic lists where the plugin should not be active. I noticed because at some point my SSL was broken due to partially loaded http content - turned out this was used in one of the topics that was displayed.

When digging further I noticed that in the Inspector>Network window and scrolling down through a topics list (where TLP is not active), you’ll see many images being pulled in that are NOT being shown on the page.

I think this is an unwanted side-effect. Can you reproduce it?

PS: did you think about my idea for supporting multiple tags?