Embedding content from The Health Hub
For UUID, use
test
to quickly check an exhaustive demo of content types, or get
the UUID from a specific piece of content in The Health Hub.
Embed code
<div class="thh-content-provider" data-uuid="xxxxxxxxxxxx" data-update-meta=".page-title"></div>
<script src="https://SISTER_DOMAIN/_resources/app/client/js-client/dist/js-client.js?thhkey=xxxxxxxxxxxx"></script>
Optional stylesheet
<link rel="stylesheet" href="https://SISTER_DOMAIN/_resources/app/client/js-client/dist/js-client.css">
Embedded Examples
How it works
The javascript client is a small piece of code that runs whenever someone visits a page on a site where it is embedded. It takes a unique identifier (TTH Record Key / UUID) and a THH key, and requests content from The Health Hub that matches the identifier. It then loads that content into a container on the page.
A visitor can then navigate and explore the content, visiting related content from The Health Hub, all while staying on the original site.
Installation
From The Health Hub, get your consumer THH key, and the Content UUID for the content that you want to initially load on the page. Paste the values into the fields below. This will update the Embed code, which you can then select and copy to use in your site. If the values are valid, you will also see a preview of the content loaded below.
Using the Embed code
The method of including the Embed code will vary, depending on the technology behind your site. If the site uses a Content Management System, and it supports putting HTML into the editor, then it will be as simple as pasting the code in and publishing. Otherwise it might require a developer to insert the code into the sites template.
Additional notes for developers
-
The html classes used in the content all start with
thh
. Make sure you don't use that class in other html on your site. - You can only embed once per page.