Developers

Default

Default template

To build a default Inbenta template, you need to specify the following parameters:

Usage

sdk.build(target:String, 'default' , options:Object);

Components:

Name Description
searchBox Input to do the search
results Component to render the results
categories Component to render the categories
categoriesBreadcrumb Component to render the categories breadcrumb
push Component to render the push contents
popular Component to render the populars
typeahead autocomplete Component to render the typeahead autocomplete

Options

Components configuration.

Options example:

With this options:

  • The popular contents will show the "popular" items belonging to "category 1".
  • The push component will load 10 content items.
  • The categories component will have content items with 2 ratings without comment.
{
  popular:
  {
    categoryId: 1
  },
  push:
  {
    length: 10
  },
  categories:
  {
    contents: 
    {
      ratings: 
      {
        elements:
        [
          {
            id:1, 
            label: 'Yes', 
            comment: false 
          },
          {
            id:2, 
            label: 'No', 
            comment: false 
          }
        ]
      }
    }
  }
}

Example:

The following example shows the creation of a build with "popular" items belonging to "category 1".

var options = {
  popular: {
    categoryId: 1
  }
};
var sdk = InbentaKmSDK.createFromAccessToken("<your_access_token>", "<your_API_Key>");
sdk.build("#inbenta", 'default', options);