Sharing facebook post with no text, just image

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 ?

2 Likes

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.

7 Likes

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?

3 Likes

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

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.