Push

Overview

This component shows push contents.

Usage

How to create this component.

sdk.component('push', target:String, options:Object);

Sample

By default, this component looks like this:

Target

This is the HTML component. For example, the "#inbenta" target is:

<div id="inbenta"></div>

Options

Available options to set in this component

Name Type Default Description
categoryId integer 0 KM App category Id
length integer 5 Maximum number of items that may be returned in collection. Minimum:1. Max:100

Default options object

{
  categoryId: 0,
  length: 5,
  contents: { <more info in subcomponent> }
}

Methods

Methods can be used in this component.

Name Description
setContentsDataInterceptor(interceptor:function) Set a contents interceptor.

Subcomponents

This component contains a subcomponent that can be configured. This component is:

Name Description
contents Component to render each content

Events

Events to listen on this component:

Name Params Description
click content: content object clicked Click on Content
expand content: content object expanded Click on expand Content
rateContent data:Object with rating data Click on content ratings

Tracking

This component calls the API endpoint /tracking/events to register a click event when a user clicks on a content.

Labels

Labels of this component. The default labels of each component can be rewritten in the sdk creation configuration.

Name Default Description
PUSH_TITLE Push HTML for push title

Examples

Create push component with related contents.

sdk.component('push', '#push', {
    contents: {
        showRelated: true
    }
});