This component shows push contents.
How to create this component.
sdk.component('push', target:String, options:Object);
By default, this component looks like this:
This is the HTML component. For example, the "#inbenta" target is:
<div id="inbenta"></div>
Available options to set in this component
Name | Type | Default | Description |
---|---|---|---|
categoryId | integer | 0 | Knowledge instance 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 can be used in this component.
Name | Description |
---|---|
setContentsDataInterceptor(interceptor:function) |
Set a contents interceptor. |
setRelatedDataInterceptor(interceptor:function) |
Set a related interceptor. |
This component contains a subcomponent that can be configured. This component is:
Name | Description |
---|---|
contents | Component to render each content |
Events to listen on this component:
Name | Params | Description |
---|---|---|
click | content : Content object |
Sent whether a content is clicked |
expand | content : Content object |
Sent whether a content is expanded |
relatedClick | integer : Related content id |
Sent whether a related content is clicked |
decisionTreeClick | decisionTree : Decision tree object |
Sent whether a decision tree content is clicked |
rateContent | rating : Rating object |
Sent whether a content rating is clicked |
This component calls the API endpoint /tracking/events
to register a click event when a user clicks on a content.
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 |
Create push component with related contents.
sdk.component('push', '#push', {
contents: {
showRelated: true
}
});