List Visual Block
List Block Define a new block in convoworks with name List Block which will make it easier to work with lists on Amazon Alexa, Google Assistant, Facebook Messenger and Viber.
Block Properties itself:
- list title -> displays the title of the list
- list template -> offers selection between carousel view and list view if possible
- items -> this is the object which contains the contents of the list items
- offset ->
- limit ->user defined limit which can be overridden by platform upper limit
- list item name -> under which name to store list item name
- list item title -> title of the item which is in the list
- list item description -> description of the item which is in the list
- list item image url -> link to the image of an item in the list
- list item image text -> accessibility text of the image of an item in the list (Required if you want to display the image!)
Block Containers:
- Read Phase -> display the list itself and support is added for other convoworks responses such as text response, set parameter, if and so on
- On No Screen Supported -> will be executed instead if the device has no support for a screen
- On List Item Selected -> will be executed when an item of the list was selected
- Additional Processors -> will be executed of another things of other processors are matched
Additional specifications:
- Define new request interfaces IConvoListRequest which will make it easier to get values from those requests from each platform and implement them in each PlatformRequest
- Define new response interfaces IConvoListResponse which will make it easier to define the final response for each platform and implement them in each PlatformResponse
Please also refer to the Dummy representation of the List Block.
Dummy representation of the List Block:
Here is an quick overview of the interface infrastructure for the List Visual Element.
IConvoListRequest makes it easier to detect any selected list item after a list response was sent.
interface IConvoListRequest extends IConvoRequest
{
/**
* @return int
*/
public function getSelectedItemIndex() : int;
}
IConvoListResponse makes it easier to declare an list response.
interface IConvoListResponse extends IConvoResponse
{
public function getListResponse(IVisualList $listDefinition) : array;
}
IVisualList is used in IConvoListResponse ->getListResponse(IVisualList $listDefinition) list response. This definition makes it clearer how the ListResponse should be formed.
interface IVisualList {
public function getListTitle() : string;
public function getListType() : string;
public function getListItems() : array;
}
IVisualItem is part of ListItems in IVisualList.
interface IVisualItem
{
public function getTitle() : string;
public function getSubtitle() : string;
public function getDescription() : string;
public function getImageURL() : string;
public function getImageText() : string;
}