Set the image used for social network sharing?

Yes this is a great fallback.

1 „Gefällt mir“

Also apologies I forgot we added that other per-category social media share image setting. I kinda blacked that out due to trauma over the earlier discussion :face_with_head_bandage:

5 „Gefällt mir“

When working on adding this feature I caught a bug. I noticed that right now here is how we prioritize OpenGraph image: first post image > opengraph_image > twitter_summary_large_image_url > site_apple_touch_icon_url.

And https://discourse.codinghorror.com did had the site_apple_touch_icon_url so the twitter:image tag was present <meta name="twitter:image" content="/images/default-apple-touch-icon.png" />.

Turns out Twitter does not support relative image paths. This is now fixed via:

Above commit also adds logo_url as last resort for OpenGraph/Twitter image tag. This updates opengraph image priority to: first post image > opengraph_image > twitter_summary_large_image_url > site_apple_touch_icon_url > logo_url.

Verified the fix on https://discourse.codinghorror.com:

7 „Gefällt mir“

When set, the large_icon may be preferable than site_apple_touch_icon_ur because it’s larger. Also we did bug everyone to set it already.

7 „Gefällt mir“

I added the large_icon as fallback. The new priority is: first post image > opengraph_image > twitter_summary_large_image_url > site_large_icon_url > site_apple_touch_icon_url > site_logo_url .

REFACTOR: Simplify finding the opengraph image · discourse/discourse@ec7f418 · GitHub

This also removes the warning that has been flooding the logs.

SiteSetting.logo_url has been deprecated and will be removed in the 2.4 Release. Please use SiteSetting.logo instead

10 „Gefällt mir“

Many of the posts in our community may contain several images.

Is there a way to tag an image or define, for a specific topic, which image to use for opengraph and social sharing?

Also, the Topic List Previews (by @merefield and @angus) plugin takes the first image in a post and uses that for the thumbnail or tile image. I’m wondering if there’s a way to tell the plugin to use the 2nd, or 3rd, or 8th image, etc.


btw @codinghorror, I got to test out that Better Insert Hyperlink feature from the 2.4 release, above, to find Topic List Previews plugin discussion, and right here with this hyperlink. Snazzy new feature!! :raised_hands:

1 „Gefällt mir“

That’s already in the plugin. I added a thumbnail picker last year :slight_smile: (btw, I’ve not considered how that might impact social sharing, feel free to experiment!).

3 „Gefällt mir“

Yes – the first big image is the one that is used. So make sure the most important image is first (and large enough, tiny images won’t work).

@merefield and @codinghorror - I can confirm that using the Topic List Previews tool not only allows you to select which image you would like to use as the featured image for your thumbnails but when doing so, that image you select will also become the image that appears for opengraph and social sharing, instead of the default setting of displaying the first image in the post!

Here’s an example where I’ve chose to use the 8th image with the “Select Thumbnail” feature and here’s how the post now appears when sharing (and on my “Latest” topics page):

Here’s how to select a thumbnail image, using the Topic List Preview plugin

5 „Gefällt mir“

Zur Information: Discourse Core kann dies seit Februar 2021 tun. Wir werden möglicherweise prüfen, ob wir es in Zukunft besser auffindbar machen können, aber vorerst können Sie den Markdown des Bildes manuell bearbeiten und eines als Miniaturansicht festlegen.

Standardmäßig verwendet Discourse das erste Bild im OP des Themas. Wenn Sie ein anderes Bild aus dem OP auswählen möchten, fügen Sie dem Markdown |thumbnail hinzu. Zum Beispiel

![alttext|100x100](upload://aaa)
![alttext|100x100|thumbnail](upload://bbb) << dieses wird die Miniaturansicht sein

(Dies wurde ursprünglich im offiziellen Thema Topic List Thumbnails diskutiert, aber diese Kernfunktion zur Auswahl von Miniaturansichten ist nicht spezifisch für diese Theme-Komponente)

5 „Gefällt mir“

Dieses Thema wurde nach 2 Tagen automatisch geschlossen. Neue Antworten sind nicht mehr möglich.