Create rich link previews with Onebox

Onebox converts your web links into useful preview excerpts that help inform readers about the target before they click through. To create a onebox, simply paste any link into a post on a line by itself, like so:

https://example.com/interesting-article

Which results in …

In addition to supporting general oEmbed and OpenGraph tags, Onebox has many custom rules for extremely popular sites including Wikipedia, Twitter, Amazon, Youtube, Soundcloud, Stack Overflow, Github and more.

Try it out! Play around with pasting links into your posts and see what happens. Experiment! Just remember, for oneboxing to work, the link must be on a line by itself! :man_scientist:

Inline Oneboxing

With the enable inline onebox on all domains site setting enabled*, pasting the link “inline” with the text, will replace the raw link with the title of the page, like this Understanding Discourse Trust Levels

like this https://blog.discourse.org/2018/06/understanding-discourse-trust-levels/

* this feature is enabled by default

Avoiding Oneboxes

If you want the link to show up as a plain, unadorned raw link, place it in < brackets >

https://blog.discourse.org/2018/06/understanding-discourse-trust-levels/

<https://blog.discourse.org/2018/06/understanding-discourse-trust-levels/>

Alternately you can place a space before the link, or any characters after the link.

Using Hyperlinks instead

You can add a link to your text by using the chain-link button in the editor toolbar, by selecting some text in your post and pasting a link from your clipboard, or by adding Markdown / BBCode / HTML links:

[link here](https://example.com)
[link=https://example.com]link here[/link]
<a href="https://example.com">link here</a>

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.

You may need to paste the full embed code such as the map above:

<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d24202.451099423397!2d-74.06201522657554!3d40.68924937923285!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89c25090129c363d%3A0x40c6a5770d25022b!2sStatue+of+Liberty+National+Monument!5e0!3m2!1sen!2suk!4v1533203877892" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>

Related: Onebox configuration and troubleshooting

39 Likes