H5P Guides

Set up H5P for Drupal

Download and install Drupal

Skip this step if you already have a running Drupal 6 or 7 installation.

Download and enable the H5P module from drupal.org

(If you use Drush, you may use "drush dl h5p; drush en h5p h5peditor" to download and enable the modules, then skip to "testing that it works".)

Download and install H5P content types

You can download all the H5P content types and libraries as a single file from the Update/install all libraries page. Install the content types and libraries by uploading the file to Administration > Content > H5P Libraries in Drupal.

Alternatively, you can download and install individual content types by following the procedure below.

First, locate a content type you want to install from the Examples and Downloads page. Press the Download button in the lower left corner of the H5P frame.

In the drupal Create content page (/node/add), select Interactive content.


Set a title and move down to the H5P section of the form and select Upload. Choose the downloaded .h5p file from above.

Finally scroll to the bottom of the form and save the node. The H5P package will be uploaded, and the containing page will be shown.

Your Drupal site can now create H5P content of the same type from scratch. Go to Create content > Interactive content and select the Create radio button to start creating new content. You can download more content types from Examples and downloads and upload them in the same manner as above.

You only have to upload an H5P content type once, to enable your site to create new content of that same type.

Roles and permissions

Depending on the framework used, access to H5P features may be controlled by defining the permissions for roles or users.

In Drupal, H5P has the following permissions available. They should be assigned users/roles as shown.

 content writersite editorsite administrator
create h5pYesYesYes
edit own h5pYesYesYes
delete own h5pYesYesYes
edit any h5pNoYesYes
delete any h5pNoYesYes
update h5p librariesNoMaybe*Yes
access all H5P resultsNoYesYes
Access own H5P resultsYesYesYes
Access h5p results for own contentYesYesYes
Create restricted H5P content typesMaybe**Maybe**Yes

* The "update h5p libraries" permissions enables the user to upload H5Ps with updated library versions. Whether or not editors should have this access is up to site policy.

Updating old content to new versions can change their appearance and functionality significantly, preserving old content through library upgrades is always one of the main focuses of a library developer. Be aware of possible versioning and content upgrades issues when letting users upload altered H5P libraries.

** The "Create restricted H5P content types" permissions enables the user to create content types that users without this permission isn't allowed to create. Admins can configure what content types are restricted at admin/content/h5p. Who should have this access is up to site policy.

Enable H5P shortcodes

The H5P module for Drupal includes an input filter allowing authors to insert shortcodes like this:

where 123 is the node id. To use these shortcodes this filter must be enabled:

  1. Go to admin/config/content/formats
  2. Click on configure for the textformat you want to enable H5P shortcodes for
  3. Enable the "H5P Content" filter, and make sure it is last in the list of enabled filters
  4. Click "Save configuration"

By doing this the H5P shortcodes should be possible to use for all authors who have access to this text format. Do note that the H5P filter disables caching for text formats using it. With page caching or similar turned on this shouldn't be noticable.

Enable result reports

By enabling Drupal's Views module a view will appear as a tab on each H5P node and on each user profile displaying basic result data.