Authoring With Course Cafe

Embedding Other Content

By

First published on May 11, 2019. Last updated on May 11, 2019.


When you need to embed content, and the above methods are insufficient, you can try iframe. To use this on Corsbook, use the [iframe][/iframe] shortcode. For example:

[iframe src="https://www.nasa.gov/mission_pages/mars/images/index.html"][/iframe].

This will display the source contents:

.NASA video shown in web version.

Here are some useful parameters for iframe:

  • height (examples: height=”50%”, height=”300px”)
  • width (examples: width=”100%”, width=”200px”)

Here is another example with lots of parameters.

[iframe class="noprint" height="50%" src="https://www.alexandriarepository.org/wp-content/uploads/20161226131424/HMMExplosiveEruption_12Oct2008_1.mp4" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture;fullscreen" ]Error.[/iframe]

You can find additional parameters, such as for sizing, at the iframe site.

There are a few ways you can make iframe better for print and accessibility:

  • class=”noprint” after the word iframe will prevent the contents from showing up in the PDF and print media.
  • alt=”your visual description” is used after the word iframe or the class statement to tell accessibility-enabled devices what would have been seen in the iframe.
  • <span class="nodisplay">NASA video shown in web version.</span> can be in text mode used after the enclosing iframe short code to provide a description that will only appear in the PDF and print modes.

COURSE


Content is copyright the author. Layout is copyright Mark Ciotola. See Corsbook.com for further notices.