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?

1 curtida

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.

11 curtidas

Works great. Thanks.

2 curtidas

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>

4 curtidas

Eu ativei isso, mas ainda não está sendo incorporado

Você o envolveu em tags iframe?

Sim, eu fiz.
Você está falando sobre iframes permitidos, certo?

Olá AryaM :slight_smile:

Aqui está um passo a passo detalhado para garantir que você configurou tudo corretamente.

Nas suas configurações do Discourse:

  1. Adicione https://docs.google.com nas suas configurações de allowed iframes:

Do Google Forms:

  1. Clique em Enviar:

  2. Clique no botão < (iframe):


    E copie o código iframe.

No Discourse:

  1. Cole o código iframe em uma postagem:
4 curtidas