Topic List Previews (legacy)

Discourse will have cached the link response so doing this is redundant.

إعجاب واحد (1)

Hrmm…is there any way to clear this cache when a post gets edited? Would that be a Discourse problem or something TLP could do?

إعجاب واحد (1)

Have you tried my suggestion of random query string? Eg myurl.com?peter=green. TLP is relatively superficial in this scenario.

إعجاب واحد (1)

I did, sorry if that was not clear, the picture did not change.

إعجاب واحد (1)

Then the og tag being used might not changing. Would need to dig into Discourse source to confirm the exact one being used.

Can you confirm the onebox image is changing within the Topic @Stanzilla? Because if that’s not changing then Onebox is definitely using a different source tag.

If the onebox is not changing then I can’t see why TLP would show anything different.

إعجابَين (2)

It’s definitely using og:image as seen here in onebox specs: onebox/open_graph_spec.rb at b816ada0cc09a374abdddf195c7986668862a26b · discourse/onebox · GitHub

Unless you are oneboxing some kind of embed, it sounds like some caching issue.

Could you remove the plugin and try my TC instead? That way I can rule out the minor overrides I’m doing for: discourse/cooked_post_processor.rb at 1472e47aae5bfdfb6fd9abfe89beb186c751f514 · discourse/discourse · GitHub here: discourse-topic-previews/cooked_post_processor_edits.rb at 971ba5d3a868506b34b61201c32640a0a6bbaa01 · paviliondev/discourse-topic-previews · GitHub in case they are the issue.

If the TC exhibits the same problem for a fresh Topic then it’s down to Discourse core criteria and code.

TC here: GitHub - merefield/discourse-topic-list-previews-theme: Enriches the content and layout of topic lists

إعجاب واحد (1)

I can confirm that the Onebox image is changing

إعجاب واحد (1)

With your Theme Component, I don’t get images at all, looks like this:

إعجاب واحد (1)

Something is breaking your javascript. Have you rebuilt without TLP? Running both will not work.

Check your console for errors.

إعجاب واحد (1)

I have rebuilt after disabling the plugin, yeah. Console only has warnings:

Edit: I did have another component that influences the styling of this page after disabling that I got the images back.

I then rebuilt the HTML of the post from the original problem and now it shows the updated image. So it works with your component but not the original TLP plugin.

إعجاب واحد (1)

I think this happens when a topic gets created using a “featured link”, when you do that it never uses the media from the actual links in the topic, and you can’t change a featured link after the fact.

Bonus fun fact: When you disable “featured links” in a category, all posts keep theirs but you can no longer remove them when editing.

إعجاب واحد (1)

Oh that’s interesting.

But what happens in TLP plugin when you create a new topic via featured link of the same target page now that the og image has been updated?

If this is too much effort you can stick with the TC.

إعجاب واحد (1)

I’ll try in a bit! TC is nice and I would stay on it if it generally just works better but I kinda want/need these other customizations to the topic list that I had to disable and don’t think I’ll have time to adopt them to special case for TC and they just work with TLP. What they do is hide the extra avatars in the list so it only shows the one of the topic creator and some more.

إعجاب واحد (1)

Okay tested in TLP, removed the featured link from a topic, rebuilt the HTML, now it does not have a image at all.

I then added ?test=true to the URL in the thread. No image.
I then rebuilt the HTML on the post, still no image.

Edit: Okay, took a while but now it has one again, and it’s the correct / latest one from the link

إعجاب واحد (1)

There is a way to not parse links in topic preview in order so they don’t break click on description and go to thread feature?

إعجاب واحد (1)

You could try some css? Eg: How to Disable Links | CSS-Tricks

إعجابَين (2)

Of course but how to hide/show links for specific user group?

إعجابَين (2)

If you need someone to build that for you, suggest posting in marketplace. That’s a bit beyond the scope of the plugin.

إعجاب واحد (1)

previews/thumbnails are taking 5 minutes to appear for me also

إعجاب واحد (1)

This is a core process that runs in the background. The plugin does not modify that. A delay is normal.

إعجابَين (2)