Embed Google Forms through Shortcode
I am updating the JustPublics@365 site and cannot insert an iFrame embed because it gets stripped out when I save. OpenCUNY recently had this issue. I am assigning this to Keith for now so that he could weigh in.
I believe the solution is that the iFrame shortcode plugin needs to be installed as a temporary plugin in order that iFrame
#3 Updated by Keith Miyake almost 6 years ago
I think most embeddable content that you might use an iframe for should be able to be embedded without having to use iframes, like with a plugin/shortcode (e.g., google docs plugin, jetpack for multimedia, etc.). If you're trying to include something from an external site that gives you an "embed" code, post the embed code here (use the "pre" tag to wrap the code so it doesn't get mangled) and maybe we can figure out an alternative that doesn't rely on iframes.
#6 Updated by Matt Gold almost 6 years ago
- Subject changed from iFrame embed stripped out to Embed Google Form
- Status changed from Resolved to Assigned
- Assignee changed from Keith Miyake to Boone Gorges
Hi Boone --
Jen Jack is trying to embed a google form on the JustPublics365 blog. Can you please let us know whether the embed shortcode you created for Google docs works for forms and if not, might it be possible to enable forms to be embedded through the shortcode, too?
#9 Updated by Raymond Hoh almost 6 years ago
Instructions to embed a Google Doc form are listed here:
Let me know if it isn't clear enough.
#10 Updated by Matt Gold almost 6 years ago
Jack - please give is a shot and let us know whether it works.
Scott -- can you please add this to our site documentation if it's not there already?
Ray -- did we already discuss packaging this as a plugin? If not, I think it's worth doing that; please let me know what you think.
#13 Updated by Raymond Hoh almost 6 years ago
How are you getting the form URL and how does your shortcode look like?
This example works for me:
The plugin is already in the wp.org repo:
#15 Updated by Jen Jack Gieseking almost 6 years ago
- Assignee changed from Raymond Hoh to Boone Gorges
Hi Boones and Ray & co.,
The shortcode works fine with spreadsheets and docs but my issue is specific to embedding a form. This shortcode does not work when I put it on a page:
[gdoc link="https://docs.google.com/forms/d/1OKLqWr998a7iXE8X_df0PWhR-3E7OhWeEwQhqINMObo/viewform" height="800"]
#16 Updated by Matt Gold almost 6 years ago
Hi Ray -- I'm confirming that this isn't working for forms. See this page. Screenshots of dashboard and published views attached. Live page here - http://cunyitconference.commons.gc.cuny.edu/submit-a-proposal/
#23 Updated by Raymond Hoh almost 6 years ago
- Status changed from Assigned to Resolved
Google Docs did update the Forms format. All newly-created Forms had a different form URL and this broke embedding for these new forms. Older forms continued to work.
Fortunately, this was an easy fix! Commit 0e7a984 should address this and will make its way into the next CAC release.
#26 Updated by Matt Gold almost 6 years ago
Hi Ray -- I'm still seeing the issue here -- http://cunyitconference.commons.gc.cuny.edu/submit-a-proposal/ . Any ideas?
And Jack, are you still experience an issue?
#27 Updated by Raymond Hoh almost 6 years ago
Thanks for the report, Matt.
I looked at your shortcode:
It should be:
Let me know if these instructions need amending:
#28 Updated by Jen Jack Gieseking almost 6 years ago
Thanks, Ray! This works beautifully for my form: http://justpublics365.commons.gc.cuny.edu/mediacamp-august/.
FYI: I used the following shortcode and it worked perfectly:
#30 Updated by Jen Jack Gieseking almost 6 years ago
Matt, I grabbed the code from the browser so the form I was working on is located at:
I believe the "spreadsheet" code you are loading may be the data from the form instead of the form itself. Possible?
#31 Updated by Matt Gold almost 6 years ago
Okay, so there are two things that I don't understand here:
1. Ray, why is Jack's shortcode working when it doesn't seem to match the setup that you put together?
2. Why is my own attempt to match Jack's code - [gdoc link="https://docs.google.com/forms/d/dDZOTlhUbnBwSTdiOWtJS0c0by1EQ2c6MA"] - not working? I'm getting the form code from the public URL of the form, as Jack did - https://docs.google.com/spreadsheet/viewform?fromEmail=true&formkey=dDZOTlhUbnBwSTdiOWtJS0c0by1EQ2c6MA
Thanks for your help.
#32 Updated by Raymond Hoh almost 6 years ago
Jack's code is different because that form is based off a newer iteration of Google Docs Forms. Your form is based off an older version of Google Docs Forms. My shortcode plugin should support both.
Can I ask if you checked out these instructions and if they are clear enough?
About why your shortcode is not working, maybe Google Docs Shortcode is not enabled on your subsite? Can you double-check? I tested your shortcode and it works on my site. I've attached a screenshot.