Embed an iframe on a Discourse hosted site


(Simon Cossar) #1

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?


(Rafael dos Santos Silva) #2

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:


(Simon Cossar) #3

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.


(Felix Freiberger) #4

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.