Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

contenthub-js

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contenthub-js

Content Hub widgets.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

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.

<!-- Optional: Get the default stylesheet. -->
<link href="https://contenthub.cloud/cdn/contenthub.min.css" rel="stylesheet">

<!-- Create a section where you want your document stream to appear with id='ch-docs'. -->
<div id="ch-docs" style="width:600px">
    <!-- Create a template of how one entry should look. #key# will be replaced by the value of the field in the document with the key. -->
    <div class="ch-document">
        <h4>#title#</h4>
        <p>#description#</p>
        <div class="ch-document__date">#publishdate#</div>
    </div>
</div>

<!-- Load the module. -->
<script src="https://contenthub.cloud/cdn/contenthub.min.js" type="module"></script> 

<!-- Configure and initialize the module. -->
<script type="module">
    import ContentHub from 'https://contenthub.cloud/cdn/contenthub.min.js';
    var chConfig = {
        apiKey: 'YOUR-PUBLIC-CONTENT-HUB-API-KEY',
        // optional: dateOptions for any fields that are dates and should be formatted
        dateOptions: { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' },
        projectId: 'YOUR-CONTENT-HUB-PROJECT-ID',
        stream: {
            // the id of the document stream container
            rootId: 'ch-docs',
            // the number of documents to load initially
            number: 3
        }            
    }
    // initialize on current page
    ContentHub.init(chConfig);
</script> 

Keywords

FAQs

Package last updated on 23 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc