Template:WEH5P
A template for pulling external H5P widgets into a course after it's been "snapshotted" to a suitable (where the person initiating the snapshot has admin permissions) WordPress site or subsite (in the case of a WordPress Multi-site implementation like [OERu's Course site](https://course.oeru.org).
Note, the external content will not be shown in the WikiEducator context, because MediaWiki (WikiEducator's underlying software platform) is rightly wary of iframed content (which this is), a capability which could be misused in a relatively unregulated environment like WikiEducator. Sensible, non-exploitative use of this template is the responsibility of whoever is initiating the snapshot of the content including this information.
Parameter
- h5pid
- the id number of the H5P content. Usually this is reported by the H5P authoring tool as something like this [h5p id=5] - in this case the h5pid would be 5.
- host
- the base domain name of the WordPress instance hosting the H5P content - do not include any sub-sites or sub-directories if the WordPress instance is a multi-site. In that case, the sub-site or sub-directory is specified separately, see below. Note, the WordPress instance displaying the H5P content must include this host within any X-Frame-Options settings. If you try to display H5P content, and your display site says it cannot display the content, it's likely due to this issue.
- subsite
- for an H5P hosting WordPress multi-site running in sub-site mode. This is for fully specifying the domain from which to retrieve your H5P content, e.g. subsite.host
- subdir
- for an H5P hosting WordPress multi-site running in sub-directory mode. This is for fully specifying the location from which to retrieve your H5P content, e.g. host/coursename/. In this case, subdir would be coursename.
- width
- optional the horizontal dimension of the viewport of the H5P content, using any appropriate CSS units like "px" (pixels - an absolute measure) or "%" (percent of available space) or "em" (based on width of average character). If not supplied, defaults to "100%" of the available width.
- height
- optional the vertical dimension of the viewport of the H5P content, also using any appropriate CSS units. If not supplied, defaults to "400px".
- style
- optional a list of CSS style rules in the form rule1: value1; rule2: value2; etc. If no rules are supplied, defaults to borderless: "border:none;"...
- classes
- optional one or more CSS classes to associate with this iframe.
- cssid
- optional a CSS id to associate with this iframe.
Sample
Here's the template invocation for the example shown below...
{{WEH5P |h5pid=1 |host=https://h5p.oeru.org |subdir=h5p |style=font-weight: bold; |height=200px |width=100% |classes=class1 class2 |cssid=id1 }}
Example
This is how the Sample template above renders in WikiEducator - it does not pull in the H5P widgets due to MediaWiki's policy on not including iframes due to security considerations - it will, however, appear, when the Wiki pages containing this template are snapshotted into the context of a WordPress site. You can see the exact syntax by clicking the [edit] link on this section!
H5P Object Parameters
The H5P parameters below will be replaced by the actual H5P object when it's rendered on the WordPress site to which it's been snapshotted.