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)

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 إعجابًا

Works great. Thanks.

إعجابَين (2)

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 إعجابات

لقد قمت بتمكين هذا، لكنه لا يزال غير مضمن

هل قمت بتضمينه في علامات iframe؟

نعم، لقد فعلت.
هل تتحدث عن الـ iframes المسموح بها؟

مرحباً AryaM :slight_smile:

إليك خطوات مفصلة خطوة بخطوة للتأكد من أنك قمت بتكوين الإعدادات بشكل صحيح.

في إعدادات Discourse الخاصة بك:

  1. أضف https://docs.google.com في إعدادات allowed iframes الخاصة بك:

من نماذج Google:

  1. انقر فوق \u003ckbd\u003eإرسال\u003c/kbd\u003e:

  2. انقر فوق الزر \u003ckbd\u003e\u003c \u003e\u003c/kbd\u003e (iframe):


    ونسخ كود iframe.

في Discourse:

  1. الصق كود iframe في منشور:
4 إعجابات