Using onebox images for topic thumbnails

Yes, thanks @merefield, but we just use @david’s theme component, not the TLP TC. But I will probably use your eval to patch core if we don’t get some movement or an option provided by the @team on this issue.

1 Like

The above render is from the TLP TC, but yes, I use a back-end plugin (the theme ‘side car’) to modify the Ruby :).https://github.com/merefield/discourse-topic-previews/tree/theme_sidecar I appreciate that may not be an option if hosted.

3 Likes

This is totally on the table, that’s why it is tagged #pr-welcome :smiley:

Check this post for a starting point for implementation.

4 Likes

@merefield Kindly can you do the PR? Unfortunately, I am completely new to Ruby. Or how is the process for a PR?

1 Like

@david I would definitely be delighted to be able to remove this override from the plugins and agree a core solution would be best.

3 Likes

@Terrapop here are the Discourse Development Contribution Guidelines

I would be a more immediate assistant on this but rammed with client work atm.

2 Likes

Understood. I just have a simple docker dev environment for developing some simple plugins and core patches, yet. Will wait until we have someone to look at this and probably patch via your eval in the meantime.

A proper job here is not an immaterial project, because you need to modify test cases, and work across the two components (discourse and discourse one-box). But definitely worth doing!

Ruby is nothing to fear after Ember btw :wink:

3 Likes

Yes, but this is defo out of my current scope and abilities unfortunately.

1 Like

As a work around I often manually copy and paste the image into a whisper, then select the thumbnail from that.

Automatic would be nicer, perhaps with a config item to give domains where thumbnails shouldn’t be taken from one boxes (i.e. to cover the github case).

3 Likes

Agreed. We used @merefield snipped to override core with a mini plugin. But it should be easy for the core team to come up with something out of the box. Not having this just because some are afraid of having their Github faces showing up is just lazy.

1 Like

I just merged https://github.com/discourse/discourse/commit/b770c30391d0294a498d73e6a5272fb437291833 which allows onebox images to be selected as topic thumbnails. There is a specific exception for the GitHub onebox, and we can add more as needed.

(cc @Terrapop @merefield)

9 Likes

Woohooo finally! Now I can disable our plugin that has overridden the core. Thank you @david

2 Likes

@merefield a bit of non related topic, but how did you include the salon.com link above the category. This is so great to create proper links between different discourse communities I believe.

2 Likes

That’s native Discourse behaviour. You don’t need any add-ins for this. Just enter the hyperlink into a title box of a fresh Topic and watch the magic :).

3 Likes

Awesome !! I didn’t know about this feature :))))

I’m trying to figure out why a bunch of Onebox topics aren’t showing in the thumbnails (absolute latest versions updated).

Let’s start with the onebox generated from this:

1 Like

@david - Onebox images aren’t coming through for me as thumbnails. This is the case when trialing both in the thumbnails TC and TLPs TC.

Has this stopped working? It would be immensely helpful for us.

Cc. @merefield

Make sure you have “download remote images” enabled.

If it still doesn’t work, can you share some oneboxes which aren’t working?

2 Likes

Ah yes - that was the problem! It requires a rebake of the posts in order to have them make the thumbnails.

I’ve added a bit to this wiki so others don’t trip up on it:

2 Likes