Link preview not working for specific site

Hi

I’m running a recently migrated Discourse forum. The nice-looking “Link previews” are generating fine for every site I’ve tried, except this one (which is important to us):

https://docs.suitecrm.com/

Since it doesn’t seem to be working here on Meta either, I wonder if it’s a bug in Discourse, or perhaps just some weirdness about the site itself, that is causing difficulties? Any clues as to what this could be?

That site is not private and does not require any login. I run that site also, so if there’s anything that needs to be done over there I can also give it a try.

Thanks.

2 Likes

The Discourse onebox gem requires that sites define Open Graph tags correctly. The site in your post doesn’t have any Open Graph tags.

So, there’s not much we can do about this. The site needs to add the necessary OG tags in order for it to be oneboxed in Discourse.

4 Likes

Perfect, that’s what I need to know, I’ll see if I can add in those tags. Thanks.

2 Likes

:thinking: so I added the tags: check my site on iframeley

And I can get a Onebox to show on WhatsApp:
image

But not on Discourse:

https://docs.suitecrm.com/developer

I wondered if this could be a caching issue, but it doesn’t look like it, I tried on different Discourse sites, and with URL variations…

Is there any other tag that Discourse requires and that I am missing? On another post here I read that title and description are the only required, and I have those two…

Thanks for your help.

1 Like

onebox visits the destination page and checks for Open Graph or oEmbed tags, including:

  • site address
  • title
  • feature image
  • description (mandatory)
  • product price

:warning: Please note that Discourse does require the description tag to be present and contain enough text to summarize the page, or the target link will not onebox.

Another good explanation is at Rich link previews with Onebox.

Advanced iFrames

By default <iframe> is blocked for security reasons, but if they are from a highly trusted source, a Discourse admin can explicitly whitelist that domain as an <iframe> target in the site settings.

Ok, thanks. I have the title and description. Perhaps it’s the lack of to og:image attribute that’s causing Discourse to dislike my site, though I didn’t read anywhere that this attribute was required.

I’ll have to try with that attribute, but I ran into some technical difficulties doing that with Hugo. When I get that solved I’ll report back here. Thanks

1 Like

This is proving difficult. So now I have the og:image in my meta, and examining with iframeley everything seems ok.

But still I can’t get Discourse to produce the onebox… :frowning:

What could be missing?

1 Like

Image isn’t enough. The text description is required as well.

I might be missing something obvious here, but what is wrong or missing about my og:description meta tag?

1 Like

Nothing, but the description must exist and it must be above a minimum number of characters, from Discourse’s perspective.

1 Like

You can check out these two links. Near the end of the 1st post in the first link is a short piece about Advanced iFrames, and immediately below the posted image is about Advanced iFrames.
Near the end of the end of the 2nd topic (Onebox challenges) is something interesting you could try… a curl - and the post gives the code to use (just swap out your URL for the one shown).
Rich link previews with Onebox
Onebox challenges

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