12.6 Adding iFrames

An iframe (short for "inline frame") lets you display another web page or piece of content inside your own page. It works like a window cut into the page. The content in that window comes from somewhere else, but visitors see it as part of your article.

Iframes are commonly used to embed:

  • Videos from YouTube or Vimeo
  • Google Maps
  • Booking, calendar or enquiry forms from other services
  • Documents, slideshows or online calculators

The content stays hosted and updated on the original website. If the source changes, your page shows the latest version automatically, with no need to edit your article.

Things to be aware of

  • Not every site can be embedded. Some websites block being shown inside other pages, and those iframes will appear blank.
  • Only embed sites you trust. An iframe loads someone else's content on your page, so use trusted sources and https:// addresses.
  • Size matters. Iframes have a set width and height, so they may need a little extra styling to look right on mobile.

Important notes below.

In order to add iframes to any of your articles, first of all be aware that by default, the article editor is set to exclude iframes because they can sometimes provide content which is undesirable. You won't know it's undesirable until later on when the website serving the iframe changes.

The other thing to be aware of is that if you feel that there's a possibility that the content from the website where your iframe gets its data from could in any way be suspect, then we can switch on a feature called sandboxing.  The sandbox attribute tells the browser to treat the iframe's content as untrusted and lock it down. In this way, the embedded page can't run scripts, submit forms, open popups, access cookies or storage as its own origin, or navigate your page away. 

How to do add an iFrame to an Article

Paste the embed code into the Code tab and save. 

Help! When I save the article with the iframe inside it, the iframe code is removed!

This can sometimes happen depending upon how the editor is configured. The way around it is to edit the article and use the HTML view to do it.

html2.png

In the image above, you will notice directly below the text which reads "Article Text" is a switch (Looks like a circle with a small arrow pointing to 12 o'clock). It's usually labelled HTML.

Click this icon to enter HTML mode and paste your iframe in directly. Then save your article.

If you have any difficulties embedding your iframes, contact us for support.