Project

General

Profile

Actions

Bug #2562

closed

Embed Google Forms through Shortcode

Added by Jen Jack Gieseking almost 11 years ago. Updated almost 11 years ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
-
Target version:
Start date:
2013-05-06
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

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


Files

Actions #1

Updated by Matt Gold almost 11 years ago

Hi Jack -- this is a feature, not a bug. iFrames present significant security risks and are thus disallowed on WP multisite installs by default. The stripping of iframes can be disabled, but I think it's a bad idea to enable that functionality.

Actions #2

Updated by Matt Gold almost 11 years ago

Also: what are you trying to embed?

Actions #3

Updated by Keith Miyake almost 11 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.

Actions #4

Updated by Jen Jack Gieseking almost 11 years ago

  • Status changed from New to Resolved

It's a google form: will embed using gdoc plugin--thanks for jumping in and clarifying, both of you.

Actions #5

Updated by Matt Gold almost 11 years ago

Great. Thanks, Jack!

Actions #6

Updated by Matt Gold almost 11 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?

Many thanks.

Best,

Matt

Actions #7

Updated by Matt Gold almost 11 years ago

  • Tracker changed from Bug to Feature
  • Subject changed from Embed Google Form to Embed Google Forms through Shortcode
Actions #8

Updated by Boone Gorges almost 11 years ago

  • Assignee changed from Boone Gorges to Raymond Hoh

It was Ray who wrote that shortcode. Ray, does it support Forms? If so, what's the syntax?

Actions #9

Updated by Raymond Hoh almost 11 years ago

Instructions to embed a Google Doc form are listed here:
https://github.com/cuny-academic-commons/google-docs-shortcode#embedding-a-form

Let me know if it isn't clear enough.

Actions #10

Updated by Matt Gold almost 11 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.

Actions #11

Updated by Matt Gold almost 11 years ago

  • Tracker changed from Feature to Support
Actions #12

Updated by Jen Jack Gieseking almost 11 years ago

Hi Ray & co.,

To clarify, this issue is only happening when trying to embed a Google Form. It is fine with all other Google docs. If you try to embed a Google Form, as I did, you will see this issue as well.

Cheers, Jack

Actions #13

Updated by Raymond Hoh almost 11 years ago

Hi Jack,

How are you getting the form URL and how does your shortcode look like?

This example works for me:

[gdoc link="https://docs.google.com/spreadsheet/viewform?formkey=dDZLLXBEUWhVRGNIS28tYlVGa21PT0E6MQ"]


Hi Matt,

The plugin is already in the wp.org repo:
https://wordpress.org/extend/plugins/google-docs-shortcode/

Actions #14

Updated by Boone Gorges almost 11 years ago

  • Status changed from Assigned to Reporter Feedback
  • Target version set to Not tracked
Actions #15

Updated by Jen Jack Gieseking almost 11 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"]

Thanks, Jack

Actions #16

Updated by Matt Gold almost 11 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/

Actions #18

Updated by Raymond Hoh almost 11 years ago

  • Assignee changed from Boone Gorges to Raymond Hoh

Sorry guys, I didn't get an email notification about this.

I think Google Docs might have changed their form URLs, so I'll have to update the way I parse that information. Looking into it.

Actions #19

Updated by Raymond Hoh almost 11 years ago

  • Status changed from Reporter Feedback to Assigned
Actions #20

Updated by Matt Gold almost 11 years ago

Great - thanks, Ray.

André, any idea why Ray didn't receive an email notification?

Actions #21

Updated by Raymond Hoh almost 11 years ago

I was removed as the assignee in comment:15 and then didn't receive subsequent email updates.

So I reassigned myself just now and am now receiving emails for this issue again.

Actions #22

Updated by Matt Gold almost 11 years ago

Aha! Got it. thanks. André, I'll take you off of the watch list.

Actions #23

Updated by Raymond Hoh almost 11 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.

Actions #24

Updated by Matt Gold almost 11 years ago

Awesome -- thanks, Ray! When the fix goes live, am I right to assume that everything should simply work without our having to change the embed code?

Actions #25

Updated by Raymond Hoh almost 11 years ago

  • Tracker changed from Support to Bug

When the fix goes live, am I right to assume that everything should simply work without our having to change the embed code?

That's right! Let me know if it works.

Actions #26

Updated by Matt Gold almost 11 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?

Actions #27

Updated by Raymond Hoh almost 11 years ago

Thanks for the report, Matt.

I looked at your shortcode:
[gdoc link="https://docs.google.com/spreadsheet/embeddedform?formkey=dDZOTlhUbnBwSTdiOWtJS0c0by1EQ2c6MA"]

It should be:
[gdoc link="https://docs.google.com/spreadsheet/viewform?formkey=dDZOTlhUbnBwSTdiOWtJS0c0by1EQ2c6MA"]

Let me know if these instructions need amending:
https://github.com/cuny-academic-commons/google-docs-shortcode#embedding-a-form

Actions #28

Updated by Jen Jack Gieseking almost 11 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:
[gdoc link="https://docs.google.com/forms/d/1OKLqWr998a7iXE8X_df0PWhR-3E7OhWeEwQhqINMObo/edit"]

Actions #29

Updated by Matt Gold almost 11 years ago

Ray, that code didn't work for me. Jack, where/how did you find that link code on the form?

Actions #30

Updated by Jen Jack Gieseking almost 11 years ago

Matt, I grabbed the code from the browser so the form I was working on is located at:
https://docs.google.com/forms/d/1OKLqWr998a7iXE8X_df0PWhR-3E7OhWeEwQhqINMObo/edit.

I believe the "spreadsheet" code you are loading may be the data from the form instead of the form itself. Possible?

Actions #31

Updated by Matt Gold almost 11 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.

Actions #32

Updated by Raymond Hoh almost 11 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?
https://github.com/cuny-academic-commons/google-docs-shortcode#embedding-a-form

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.

Actions #33

Updated by Matt Gold almost 11 years ago

Aha -- I thought the shortcode was activated automatically, so I never enabled it. Everything is working now, and the directions are clear. Many thanks.

Actions

Also available in: Atom PDF