# Whitelist, allowed iframe

**URL:** https://meta.discourse.org/t/whitelist-allowed-iframe/97738
**Category:** Feature
**Created:** [September 21, 2018, 8:23am UTC](https://meta.discourse.org/t/whitelist-allowed-iframe/97738 "2018-09-21T08:23:51Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![TeoWneD](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@TeoWneD](https://meta.discourse.org/u/TeoWneD)
#### Post date: [September 21, 2018, 8:23am UTC](https://meta.discourse.org/t/whitelist-allowed-iframe/97738/1 "2018-09-21T08:23:51Z")

</div>

Continuing the discussion from [Supporting iframe embeds from different domains?](https://meta.discourse.org/t/supporting-iframe-embeds-from-different-domains/30930/61):

> [@Supporting iframe embeds from different domains?](https://meta.discourse.org/t/supporting-iframe-embeds-from-different-domains/30930/61):
>
> iframes can now be whitelisted through the **allowed iframes** Site Setting.

Does it mean i can put an iframe on discourse, or it means that i can have discourse on my website in an iframe ?

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [September 21, 2018, 8:25am UTC](https://meta.discourse.org/t/whitelist-allowed-iframe/97738/2 "2018-09-21T08:25:27Z")

</div>

> [@TeoWneD](#):
>
> Does it mean i can put an iframe on discourse, or it means that i can have discourse on my website in an iframe ?

The former.

Discourse does not work in iframes on other domains and this is not supported I understand.

---

<div class="post-metadata">

### Author: ![TeoWneD](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@TeoWneD](https://meta.discourse.org/u/TeoWneD)
#### Post date: [September 21, 2018, 8:35am UTC](https://meta.discourse.org/t/whitelist-allowed-iframe/97738/3 "2018-09-21T08:35:40Z")

</div>

I installed it on my own server, is there any thing i can modify, to allow the iframe using?

_iframes can now be whitelisted through the **allowed\_iframes** Site Setting. It accepts a list of iframe src domain prefixes that discourse can safely allow in posts. The whitelist-iframe plugin is no longer required._ So this mean discourse can have an iframe on it but you cant put discourse in an iframe right ?

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [September 21, 2018, 8:38am UTC](https://meta.discourse.org/t/whitelist-allowed-iframe/97738/4 "2018-09-21T08:38:44Z")

</div>

> [@TeoWneD](#):
>
> So this mean discourse can have an iframe on it but you cant put discourse in an iframe right ?

Correct. I wouldn’t attempt the latter. I’m sure the team could tell how much would break, but I suspect a lot would. There’s all kinds of in browser code running which might be affected.

---

<div class="post-metadata">

### Author: ![TeoWneD](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@TeoWneD](https://meta.discourse.org/u/TeoWneD)
#### Post date: [September 21, 2018, 8:40am UTC](https://meta.discourse.org/t/whitelist-allowed-iframe/97738/5 "2018-09-21T08:40:51Z")

</div>

😢 this is so sad, we needed that feature

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [September 21, 2018, 8:42am UTC](https://meta.discourse.org/t/whitelist-allowed-iframe/97738/6 "2018-09-21T08:42:02Z")

</div>

There are ways you can have read only outputs of posts and there’s an API to access posts externally (no expert on that but search on API), but if you want access to all Discourse functionality, it has to run full page.

> [@Embed whole Discourse board into Wordpresspage](https://meta.discourse.org/t/embed-whole-discourse-board-into-wordpresspage/56094/2):
>
> You can set the same header, footer, style and fonts on both sites so they feel the same site. Using Discourse inside an iframe isn’t supported.

---

<div class="post-metadata">

### Author: ![TeoWneD](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@TeoWneD](https://meta.discourse.org/u/TeoWneD)
#### Post date: [September 21, 2018, 8:45am UTC](https://meta.discourse.org/t/whitelist-allowed-iframe/97738/7 "2018-09-21T08:45:07Z")

</div>

in uthopia world, would have for exemple 10 subjet on discourse, and 10 ‘‘program’’ on my website depending on what program you took on my website there is an iframe of the corresponding subjet from discourse. so it would look like this

 ![37](https://global.discourse-cdn.com/meta/original/3X/8/c/8ce0f543cc3ed403957a4a60aaf69c577ad463d0.png) so we won’t need all the discourse feature.

Connect and login would’nt be here as we setted up sso.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [September 21, 2018, 8:49am UTC](https://meta.discourse.org/t/whitelist-allowed-iframe/97738/8 "2018-09-21T08:49:25Z")

</div>

Take a look at:

[https://meta.discourse.org/t/have-you-considered-a-feature-for-embedding-discourse-topics-into-other-websites/14975](https://meta.discourse.org/t/have-you-considered-a-feature-for-embedding-discourse-topics-into-other-websites/14975)

---

<div class="post-metadata">

### Author: ![TeoWneD](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@TeoWneD](https://meta.discourse.org/u/TeoWneD)
#### Post date: [September 21, 2018, 9:36am UTC](https://meta.discourse.org/t/whitelist-allowed-iframe/97738/9 "2018-09-21T09:36:09Z")

</div>

Thanks for the usefull links, i’m actually investigating what alternative we got.  
The part with embed comment’s is really helping.  
[https://eviltrout.com/2014/01/22/embedding-discourse.html](https://eviltrout.com/2014/01/22/embedding-discourse.html)  
The part where you can embed some comments, is making me think, can we instead of emebeding comments, embed for example:??

 ![zerzer](https://global.discourse-cdn.com/meta/original/3X/7/b/7b49bff05bb672563eb4037eb7e21cc5400ff777.jpeg)  
embed “Objectif standard” ? For example ( the yellow tile ) OR/AND the 2 thread stared in it ?  
If i can do the same but instead of embed comments, i would embed a category, ( even if its read only and you have to go fullscreen to answer it’s closer to what we want.

---

<div class="post-metadata">

### Author: ![tmoko](https://avatars.discourse-cdn.com/v4/letter/t/da6949/32.png) [@tmoko](https://meta.discourse.org/u/tmoko)
#### Post date: [September 27, 2018, 1:28am UTC](https://meta.discourse.org/t/whitelist-allowed-iframe/97738/10 "2018-09-27T01:28:34Z")

</div>

> [@Embedding Discourse Categories / Latest Topics into Site](https://meta.discourse.org/t/embedding-discourse-categories-latest-topics-into-site/91219/5):
>
> If you are wanting to include a Discourse category into another site I think you’ll have a much better time with a category that isn’t a restricted category. Also, AFAIK, Discourse is not intended to work from within an iframe. However, you should be able to get RSS and / or JSON and be able to work with that.

Edit: \*I am not familiar about JSON and RSS feeds, I discovered `/c/<category_name>/l/latest.json` also exists.

* * *

> [@TeoWneD](#):
>
> [![37](https://global.discourse-cdn.com/meta/original/3X/c/8/c82defd013639a56c8bb61508ed7c2d92c5e20a4.png)  
> capture\_d\_\_\_e\_\_cran\_2018-08-29\_a\_\_\_18.14.37.png2988x2188 435 KB  
> ](https://global.discourse-cdn.com/meta/original/3X/8/c/8ce0f543cc3ed403957a4a60aaf69c577ad463d0.png)

I hope you will be able to style your discourse like this.. I think it looks beautiful, even if not what you initially intended 😅 👍

---

<div class="post-metadata">

### Author: ![robmc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmc/32/125900_2.png) [@robmc](https://meta.discourse.org/u/robmc)
#### Post date: [September 27, 2018, 10:17am UTC](https://meta.discourse.org/t/whitelist-allowed-iframe/97738/11 "2018-09-27T10:17:21Z")

</div>

Why don’t you simply style your Discourse header to match your existing site? This requires CSS and theme changes, no need for iframes

you can read more about themes and theme components here:

> [@Beginner's guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966):
>
> This is a crash course in Discourse theme basics. The target audience is everyone who is not familiar with Discourse themes. If you’ve already used Discourse theme / theme components, this guide is probably not something you need to read. What are themes and theme components? A theme or theme component is a set of files packaged together designed to either modify Discourse visually or to add new features. Let’s start with themes. Themes In general, themes are not supposed to be compatible …

---

<div class="post-metadata">

### Author: ![TeoWneD](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@TeoWneD](https://meta.discourse.org/u/TeoWneD)
#### Post date: [September 27, 2018, 11:07am UTC](https://meta.discourse.org/t/whitelist-allowed-iframe/97738/12 "2018-09-27T11:07:25Z")

</div>

Thanks for your replies, i’m actually investigating :).

> [@robmc](#):
>
> Why don’t you simply style your Discourse header to match your existing site?

I will start by giving a bit of our context:  
we provide specific food planning for specific profile:

- example a pregnant woman

There is 2 way our user can access the forum. A regular one, where you click on the tab ‘forum’ and it redirect you to our forum. This way is actually working properly. ( see screeshot 1 )

 ![12](https://global.discourse-cdn.com/meta/original/3X/d/d/ddaf51e34444c3c7308f791a10f8a8f7a8dd0806.jpeg)

Now the second way ( the reason why we looked for iframe etc )One of our user come on our website as example 1 ( pregnant woman ) under her planning, she will see the pregnant woman category from forum.  
Why we wanted iframe first ? to embed category like this

 ![azeae](https://global.discourse-cdn.com/meta/original/3X/4/8/481673df189c58b641979e982fd8d0d19b7f792a.jpeg)

So changing the theme would solve half of our problem and create others. If we could have the corresponding forum category embeded under our planning would be the exact behaviour that we are looking for
