Developers

GetPopularResults

Usage

Use this method to re-request popular results using a configuration that differs from the one originally defined for the Popular component when it was created. Using this method overwrites the values of the categoryId, length and interval options originally defined:

popular.getPopularResults(options:Object);

Mandatory parameters

This method has no mandatory parameters.

Options

The options you can set in this component are:

Name Type Default Description
categoryId integer 0 Knowledge instance category ID
length integer 5 Maximum number of items to be displayed as popular contents. Minimum:1. Max:100
interval string allTime Time interval from which the most popular contents should be retrieved. Possible values: allTime, lastWeek and lastDay.

Response data format

This method does not return any values.

Example

This is an example of the values that can be included in a call to the getPopularResults method:

let popular = sdk.component('popular', '#popular');
let popularOptions = {
  categoryId: 0,
  length: 2,
  interval: 'allTime',
};
popular.getPopularResults(popularOptions);