To build a default Inbenta template, you need to specify the following parameters:
sdk.build(target:String, 'default' , options:Object);| 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 |
Components configuration.
Options example:
With this options:
popular contents will show the "popular" items belonging to "category 1".push component will load 10 content items.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);