Content Hub
A Javascript Plugin for dynamic content via the Content Hub platform without dependencies.
How it Looks Like
Example on the foosball tracking app KickTrack:
Installation
Download the contenthub.min.js and contenthub.min.css or simply install via bower writing bower install contenthub-js
or via npm writing npm install contenthub-js
.
Configuration and Usage
For suggestions to work you have two parts. First, the unibox.min.js and unibox.min.css need to be included and configured on the page. Second, the server needs to give search suggest data for the plugin to show.
<link href="https://contenthub.cloud/cdn/contenthub.min.css" rel="stylesheet">
<div id="ch-docs" style="width:600px">
<div class="ch-document">
<h4>#title#</h4>
<p>#description#</p>
<div class="ch-document__date">#publishdate#</div>
</div>
</div>
<script src="https://contenthub.cloud/cdn/contenthub.min.js" type="module"></script>
<script type="module">
import ContentHub from 'https://contenthub.cloud/cdn/contenthub.min.js';
var chConfig = {
apiKey: 'YOUR-PUBLIC-CONTENT-HUB-API-KEY',
dateOptions: { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' },
projectId: 'YOUR-CONTENT-HUB-PROJECT-ID',
stream: {
rootId: 'ch-docs',
number: 3
}
}
ContentHub.init(chConfig);
</script>