Why doesn't this link display a onebox?

(Philip Rhoades) #1


I have put this into a post on my Discourse site but I noticed it did not create a thumbnail of the page in the post - and it doesn’t seem to be working here either . .


Am I missing something or is it something to do with the site itself? Some JS thing or something?


(Joe) #2

The site you’re trying to link to does not have any OpenGraph tags. That’s why Discourse does not generate a preview for it.

(Philip Rhoades) #3

@joe , Right - thanks for that info - I will look it up . .


(Philip Rhoades) #4

@Johani ,

I just put the four required properties for every page on my personal web page here:


but that isn’t working either - am I still missing something? (I even restarted nginx to see if that would help).


(Jeff Atwood) #5

Have you checked it using http://iframely.com/debug – I’d start there first.

(Arpit Jalan) #6

Yes, both og:title and og:description must be present for onebox to work on Discourse. Currently og:description is missing on your site.

Onebox not working for some links
(Philip Rhoades) #7

After adding

(the ogp page says “The four required properties”)

looks OK but after re-editing the Discourse post and re-starting nginx again . . still no go . . could it be a caching thing somewhere?

(Arpit Jalan) #8

That is true but for oneboxing to happen on Discourse, the onebox gem require both og:title and og:description as per:

(Philip Rhoades) #9

OK, thanks for that - but if the framely check is working, shouldn’t my link in the previous post above just start working? (I even tried editing and resaving it).

(Régis Hanol) #10

There is indeed a cache. Try adding a random query parameter to the URL (if supported).

(Philip Rhoades) #11

Trying again here:


  • OK now that is displaying in the preview on the right properly . . will it display after I hit “Reply” ?

(Philip Rhoades) #12

No . . I don’t get it . .

(Arpit Jalan) #13

Now that you have added og:description as well, the oneboxing will work. Let’s test here:

(Christoph) #14

I suppose the rationale is that a one-box that contains nothing but the title would be meaningless. But I think the second element doesn’t have to be the description. In the example above, for example, I think it would work fine with just title and image. So how about requiring title plus image or description?

(Philip Rhoades) #15

@techAPJ ,

Hmmm . . I can see it has worked for you - why did it show up like that in the preview box for me but then NOT in the post itself?

If I refresh the page, shouldn’t that same link now show up where I have used it above?

(Jeff Atwood) #16

You would need to rebake existing posts.

(Philip Rhoades) #17

Does that mean create anew?

(Jeff Atwood) #18

No. Press the admin wrench on the post and select “rebuild html”

(Philip Rhoades) #19

Ah! Excellent - many thanks!