8 Toggle This

The H5P Accordion content type is well used for reducing the amount of content displayed by using folding “drawers” that open or close. They also are useful for creating thought questions with the answers or followup information hidden.

This is fine. But a limit for the H5P content type is that it is not going to be available for PDF and ePub versions of your textbooks, instead a link is published to return to the web site.

As pointed out to use by Steel Wagstaff, we do have another option that works because it is web standard HTML, and thus should work in these formats.

This is using the HTML tags for Summary/Details.

Let’s experiment.

What Are Accordions For?(show/hide)

The H5P documentation spells it out nicely:

Reduce the amount of text presented to readers by using this responsive accordion. Readers decide which headlines to take a closer look at by expanding the title. Excellent for providing an overview with optional in-depth explanations.

You can see that this might be effective to reduce long lists of information, references, or breaking content into sections more like a miniature outline.

In this case, it’s used just a silly demo.

Foot Stomping Music(show/hide)

Well, that was silly. It would be useful maybe if one could include images here, but alas not in H5P.

But we can!

2011/365/135 Accordion Man

Something Extra Sneaky!(show/hide)

Were you expecting that? Have we reached some form of H5P Inception?

As not all browsers will indicate the left side triangles to indicate an item to open, we add prompt text “show/hide” inside the <summary> with <em> tag. With some custom CSS (in Pressbooks, go to Appearance -> Custom Styles and enter into the space for “Web Styles”. We can make the interaction more clear with background color, a cursor on hovering, and moving the prompt text to the right side.

details {
  background: #eee;
  margin-bottom: 2rem;
  padding: .5rem 1rem;
}

summary {
  cursor: pointer;
}

summary > * {
  display: inline;
}

summary em {
    font-size: 80%;
    float: right;
}

License

Icon for the Creative Commons Attribution 4.0 International License

Cooking in the H5P Kitchen Copyright © by BCcampus is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.

Share This Book