Sharing facebook post with no text, just image

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

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=";version=v6.0"></script><div class="fb-post" data-href="" data-width="552"><blockquote cite="" class="fb-xfbml-parse-ignore">Posted by <a href="">Elisabeth Millot Nguyen-Duc</a> on&nbsp;<a href="">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.


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