Contents

Overview

This subcomponent is defined to show the content attributes, related contents and decision tree contents defined in the Knowledge Management App.

Usage

This component is located inside many components such as Results, Popular or Deflection. It can be tuned changing its options from the parent component. For details, see the example below.

Sample

By default, this component looks like this:

Options

Available options to set in this component

Name Type Default Description
settingsToShow array ['ANSWER_TEXT'] array of settings to should be show in the content
settingsImg string Settings to show an image before content title
showRelated boolean false Show related contents
openContentOnClick boolean true Show content body when content title is clicked

Default options object

{
  settingsToShow: ['ANSWER_TEXT'],
  settingsImg: '',
  openContentOnClick: true,
  showRelated: false,
  ratings: { <more info in subcomponent> }
}

Methods

This subcomponent does not have any methods.

Subcomponents

This component has some components inside which can be configured. This components are:

Name Description
ratings Component to render the ratings
related Component to render the related
decisionTree Component to render the Decision Tree

Events

This subcomponent does not have any events.

Tracking

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

Example

Create popular with contents settingToShow to SHORT_ANSWER_TEXT.

sdk.component('popular', '#popular', {
  contents: {
    settingsToShow: ['SHORT_ANSWER_TEXT']
  }
});