[ARCHIVE] Topic List Previews

(Bart) #810

Yeah I understand where the optimized images come from; I guess my point was more that in this case several optimized sizes are available. I think a good solution could be to select the smallest possible existing optimized image size that’s larger than what we need and just crop it in CSS - no point in generating yet another image size unless we have to? Re-use would save me a ton of diskspace :wink:

(Angus McLeod) #811

Sure, I’ll take a look at whether that’s possible later today.

(Angus McLeod) #812

This is what it currently does.

If there is an optimised image generated by Discourse for the purposes of display in the topic, TLP falls back to that if there is no size-specific optimized image for the topic list in question.

If you see a full size, non-optimized image being used in featured images, it means that Discourse itself hasn’t generated an optimized version for the topic yet.

There’s a performance - disk-space trade off here. The perf-optimal solution is to add feature-specific sizes. The argument would be that it’s relatively easy to add more disk space, but it’s harder to improve the performance effect of loading a larger image than necessary. But I’m happy to be persuaded otherwise.

I’ll push some more updates to the featured_images_branch tmr

(Bart) #813

That makes sense, thanks for explaining! I feel a bit of a noob for asking, but where can you configure the optimized image sizes + how do I force a ‘rebuild’ of the optimized images for a specific post?

After reading through your post, I suppose adding a feature-specific size is probably a good tradeoff indeed. The extra diskspace is probably outweights the extra charges on my CDN bill :wink:

(Angus McLeod) #814

This is now fixed.

I’m not sure what you mean here? Feature topics aren’t currently on mobile.

The latest updates on the featured_images_refactor branch are live on my sandbox.

Anything else before we merge you think?

(Bart) #815

Hey Angus!

The order of the featured images is now lost - I think it goes from oldest to newest.

Also, did you see this question?

I feel a bit of a noob for asking, but where can you configure the optimized image sizes + how do I force a ‘rebuild’ of the optimized images for a specific post?

For example, my featured images are currently set to 177x77 - how can I set up a good ‘optimized’ image size for these?

On mobile, topic images aren’t square.

This was not referring to the featured images, but to the topics previews. I can’t reproduce it anymore though, so most likely an issue on my end.


(Angus McLeod) #816

As the featured images uses the optimised image generated for the post, there isn’t exactly an optimal size, as the optimised post images are of variable size (See further here). As long as you don’t set them wider or taller than the max image width and max image height (both core settings).

Once we add featured-image-specific optimized images, the optimized image generated will be exactly the height and width of the dimensions for featured images (i.e. topic list featured width and topic list featured height).

I’ll check this tomorrow.

(Daniel Nevoigt) #817

Running in a small problem. Just have installed your plugin and not even tested it out. So I made a post in my Forum with a Onebox, that Onebox tried to load a image from that link over http not https, I don´t know why. After that I got an error in browser about security and mixed content stuff, so I deleted the onebox and just mentioned the name. After that, reloaded the post and the error was gone.

Now comes the tricky thing. When browsing to the category of that post I get that error back instant. I can only get rid off that error when in Admin->Settings->Plugins-> topic list previews enabled: I disable that option. But thats not how it should go :slight_smile:
Is there something cached somewhere which still hasn´t updated?

Sorry for my bad english and thanks for the help.

EDIT: When looking to source-list of that page, the url causing that problem is stored in that javascript phrase:


(Hakan) #818

Would not it be nice to upload thumbnails to the server that show up in links from YouTube and other sites? because there may be problems on the opposite side of the container and the image gets worse, it may be better to upload the thumbnail on the site

(Angus McLeod) #819

Could you link me to the topic you’re talking about?

Or alternatively could you post the same content in the Topic List Previews category on my sandbox?



(Daniel Nevoigt) #820

Hi @angus,

thx for your reply, and yes, no problem. (Forum is under development, please don´t judge the look and content :slight_smile: )

The topic is here:

As you will see, everything clear and not showing any problem.

The category:

Thank you very much.

Edit: I have deleted the post and just posted it new without the initiated Onebox, now the mixed content stuff is gone.

(Daniel Nevoigt) #821

Sorry for another question :slight_smile:

About the featured Image stuff, really great feature, definitely. So I set it up for a specific category, works fine and looks amazing too, but, when than just changing the page to startpage, clicking on my logo, I have the featured image still showing up above the categories. I think thats somehow a missconfiguration of my installation, as on your sandbox it is working well. Do you have any idea what that could be?

(Angus McLeod) #822

Have you enabled it at the category level, instead of the site level? Make sure the site-level settings are turned off. Also post your all TLP category and site level settings here (use the > details feature so the post isn’t big).

(Bart) #823

Hey Angus, did you have time to look into that sorting issue of the featured images yet?

(Daniel Nevoigt) #824

Hi @angus, yes, you can see in the following settings how is everything at my page set up. I just have noticed that it also happens when going from a TPL topic through the dropdown clicking on “all categories”.

site level settings

topic list social


topic list thumbnail


topic list excerpt


topic list action


topic list category badge move


topic list set category defaults


topic list show like on current users posts


topic list excerpt length


topic list default thumbnail


topic list default thumbnail fallback


topic list thumbnail width


topic list thumbnail height


topic list hotlink thumbnails


topic list thumbnail first x rows


topic list previews enabled


topic list featured images


topic list featured images category


topic list featured images topic


topic list featured images tag


topic list featured images count


topic list featured width


topic list featured height


topic list test image url timeout


TLP category settings

Apply social feed arrangement to selected lists in this category.


Show topic preview thumbnails in selected lists in this category.

latest, new, unread, top, suggested, latest-mobile

Show topic excerpts in selected lists in this category.

latest, new, unread, top, suggested, latest-mobile

Show like and bookmark buttons in selected lists in this category.

latest, new, unread, top, suggested

Show category badge under topic title in selected lists in this category.

latest, new, unread, top, suggested, latest-mobile

Image URL for thumbnail shown if topic in this category has no preview thumbnail set.


Width of thumbnails in this category (rebake your posts if you change this).


Height of thumbnails in this category (rebake your posts if you change this).


Enable featured images in this category.


(Angus McLeod) #825

@bartv Not yet, but I’ll take a look at it tomorrow. @Daniel_Nevoigt I’ll take a look at your issue tomorrow as well.

(Angus McLeod) #826

@bartv I’ve fixed the issue with the featured images order.

And I’ve merged the featured images branch into master.

@Daniel_Nevoigt I was working on a complete refactor of featured images with @bartv which has now been merged. Please give it another shot and see if your issues have been fixed.

Live on my sandbox: Topic List Previews - Angus' Sandbox

(Bart) #827

Looking good Angus, thanks!

(Daniel Nevoigt) #828

@angus thx for your effort, but in my case that TPL upgrade did not solve the problem.

I have fixed it for now with simply css:

.navigation-categories .featured-topics-discovery {
display: none !important;
visibility: hidden !important;

EDIT: Well, my css also won´t work anymore, as now the featured images from that one category I have them enabled show up in each other category and sub category too…super gau :slight_smile:

(Angus McLeod) #829

This should fix your issue. Please give it another whirl.