Embed an iframe on a Discourse hosted site

I have a client who would like to be able to embed an iframe on a Discourse hosted site. As far as I can tell, it isn’t currently possible to whitelist an iframe through a site customization - the post is cooked on the server, so adding a new regexp to _validIframes in a customization has no effect.

The best I’ve been able to come up with is to embed the iframe through Codepen. That works as a proof of concept, but the UI isn’t right for what we’re trying to do.

The goal is to be able to embed an iframe that’s generated on a WordPress site to create a map of the forum’s users. Something similar to what is outlined here: Visual map of users

Is this something that there is any demand for? If so, does anyone have an idea of how to approach it?

The correct approach is the app to provide an oembed, so it will onebox and will be able to use an iframe inside the onebox.

Like a Google Maps uses an iframe:

https://www.google.com.br/maps/place/Vila+Industrial,+São+Paulo+-+State+of+São+Paulo/@-23.6070449,-46.5407708,16z/data=!3m1!4b1!4m5!3m4!1s0x94ce5d401da3279f:0x26ccbdf13f9aa007!8m2!3d-23.6070284!4d-46.532541

5 Likes

That looks very promising. The problem is that I’m creating the iframe on a WordPress site. It looks like it could be setup as an oembed provider, but I haven’t yet figured out how to do that.

For now, I’m just going to add the iframe to a post with javascript. That works well for what I need to do.

Actually, this Google Maps embed is broken for me. I should I be able to zoom and click the links, right? I cannot get any interaction out of the embed, it behaves like an image.

4 Likes