Sharing facebook post with no text, just image

AI-generated summary

Users are discussing the challenge of sharing Facebook posts containing only images on Discourse, as these posts lack text content and omit the og:description tag. evantill found a workaround by allowing the URL inside an iframe in the Discourse parameters. Falco tested with different Facebook posts and confirmed that the issue is specific to posts with no text content. merefield noted that the post must be public for this to work.

a User tried to share a link to a facebook post :

https://www.facebook.com/Millot.Elisabeth/posts/10221325515184674

I was expecting a onebox but this is not the case.

Checking the url it has an html attribute containing html code for an iframe.

html code
<div id="fb-root"></div> <script async="1" defer="1" crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&amp;version=v6.0"></script><div class="fb-post" data-href="https://www.facebook.com/Millot.Elisabeth/posts/10221325515184674" data-width="552"><blockquote cite="https://www.facebook.com/Millot.Elisabeth/posts/10221325515184674" class="fb-xfbml-parse-ignore">Posted by <a href="https://www.facebook.com/Millot.Elisabeth">Elisabeth Millot Nguyen-Duc</a> on&nbsp;<a href="https://www.facebook.com/Millot.Elisabeth/posts/10221325515184674">Saturday, April 4, 2020</a></blockquote></div>

allowing the url inside this iframe in our discourse parameters I finally had a onebox.

Is there any easier solution to obtain the same result ?

Let me test with a random post:

Looks like it embed just fine :thinking:

Let’s try with an image

Yep, also embed fine.

On your example, the post has no text content, just an image. That makes Facebook omit the og:description tag. Without that tag, Discourse doesn’t create a onebox. And since it doesn’t provide og:type of image, we have no pointers of what to do with it.

Also to add (at the risk of stating the obvious): for this to work the post needs to be public, although it seems to be in this case?

yes, the post seems to be public. I have tested in firefox private mode.