How to embed a Google Form?

I’ve been trying without success to embed a Google Form. The embed code provided by Google Forms is an iframe. Is this compatible with Discourse?

It is - you’ll have to allow the https://docs.google.com as the source domain prefix in allowed iframes.

Search for iframe in your Discourse settings.

Works great. Thanks.

Good to know. What are the risks connected to whitelisting https://docs.google.com for iframes? It’s a pretty huge and diverse domain…

I don’t know. Perhaps someone from the Discourse team can answer how iframes are walled off from the application.

Whitelisting could be narrowed down to the specific form, though. For example, this will work as an allowed iframe source:

https://docs.google.com/forms/d/e/1FAIpQLSfshJKrg_toMlnQtiUeBILwdiCTQhs54z7xHgzbRVuiQyJ6I/viewform

The full source from Google for the example above would be:

<iframe src="https://docs.google.com/forms/d/e/1FAIpQLSfshJKrg_toMlnQtiUeBILwdiCTQhs54z7xHgzbRVuiQyJ6I/viewform?embedded=true" width="760" height="500" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>

이 설정을 활성화했는데도 여전히 임베드가 되지 않습니다.

iframe 태그로 감쌌나요?

네, 맞아요.
허용된 iframe에 대해 말씀하시는 거죠?

AryaM님, 안녕하세요 :slight_smile:

설정을 올바르게 구성했는지 확인할 수 있도록 단계별 세부 안내를 드립니다.

Discourse 설정에서:

  1. allowed iframes 설정에 https://docs.google.com을 추가합니다:

Google Forms에서:

  1. 보내기를 클릭합니다:

  2. < > (iframe) 버튼을 클릭합니다:


    그리고 iframe 코드를 복사합니다.

Discourse에서:

  1. 게시글에 iframe 코드를 붙여넣습니다: