Embedding External Content in a Page
Most web services like Twitter, Facebook, YouTube, Google Forms, Flickr, and others allow you embed content from your account on their website into an external web page. This is most often done using something called an iFrame. This page is going to show one example embedding a Google web form onto a page. The same idea can be used for any of these other services.
- Get the "Embed Code" for the web service you want to include on the page. Each application will be different but they will usually include the phrase "embed html" or "embed code" somewhere on the editing interface for the application. It will provide you with a "snippet" of html you can use that will likely be an iframe. Here is the example for our web form we are going to embed. You copy this code into your computer clipboard (e.g. select text and press Ctrl-C on a PC or Cmd-C on Mac):
<iframe src="https://docs.google.com/a/geneseo.edu/forms/d/e/1FAabcdefghijklmnop/vie…" width="760" height="500" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>
The screen for Google forms might look something like the following:
- Open the page where you want to embed the code. Switch the text mode to "Advanced"
- Press the source button which will remove the rich text editor and display the page's raw html. Position the cursor in the page where you want the content to appear and then paste it into the page:
- Press save to reveal the page with the embedded content. Note that in our example the page appears cut off at the bottom. There is actually a vertical scroll bar that would reveal the remaining content at the bottom, but this is not desirable for our web page.
- Edit the page, click on the iframe within the page, and press the iframe button in the editor
- Adjust the height component to be large enough to reveal all the content in our iframe. In this case we will set it to 800.
- Save the settings and save the page to reveal the changes.
- You need to know a little about HTML in order to position the iframe or other embed code within your page, but this is normally fairly easy to figure out based on the content. You can, however, also create your iframe initially using the iframe button. Just paste the individual pieces (e.g. url, width, height, etc.) into the corresponding fields of the iframe editor. This may be easier if you prefer working within the rich text editor.