What is CMS?
CMS (Content Management System) is one of special features by BotStar. With CMS, you can create and manage digital content for your bot. Also, CMS allows your users browse your products on chatbot easily. CMS by BotStar are made of Entity and Item:
Entity is a set of items that have the same attributes (fields).
Item is data object that has attributes (fields) defined and grouped by Entity.
Why should you use CMS for chatbot?
By using CMS, you can get some benefits:
Easily maintain and update the data without being impacted by the flow.
Supported with multiple languages.
CMS Items can be filtered and linked together for searching information purpose
Load CMS data into blocks in Flow Editor helps you update content of blocks automatically if there is any change from Entity of CMS. You do not need to put data in each block manually. Especially, for listing blocks such as Horizontal List, Vertical List, items of an Entity will automatically be listed in these blocks.
Set up CMS
Applying CMS is about creating and managing Entity. Each Entity is defined by Fields. Each Item of an Entity contains information corresponding to those fields.
On the screen of CMS, you can:
Define New Entity
Head up to the button New Entity in the upper right corner of the screen
Enter the Entity Name to manage your content system
Click Create to finish defining an Entity
Create an Entity
Update or add many Fields for each Entity by selecting the button configuration nearby the Entity name in the list of Entities.
Form Fields, you will see the two default fields of Entity, which are Name and Status. You could not be able to edit or delete these two fields. Read more about these two default fields
In order to add a new field, you need to fill in sufficient information:
Field Name: define the name of an Entity (eg. Photo, Price, Description,etc)
Field Unique Name: value of this data can not be duplicated with Field Unique Name of other fields
Type: there are 7 types of field below
Text: This field is a text (including newline character)
Text (multiple values): This field is a set of paragraphs.
Single Option: This field is a value that was defined before.
Multiple Options: This field is a set of values that was defined before.
Entities Reference: This field could link to another Entity's item. It shows the relationship between the current Entity and refered Entity. Read more about Entity Reference Field
Photo: This field holds a value which is a photo URL from the Internet or a photo uploaded directly from your computer.
Date: Data in the form of date.
Click the button
+in the same line of each field to finish creating an Entity. You can also delete any field by selecting the button shaped the Trash.
Create CMS Item
There are two default fields which are Name and Status in Form Fields of each Entity:
Name: define the name for items of an Entity.
Status: carry one of two values Enabled / Disabled
Enabled when an item is used normally, and be listed when it is used in other places.
Disabled when an item is deactivated and just be listed only in the CMS site. It will not be shown in other places.
After defining or updating an Entity, you can create items for the Entity by click on that Entity to open the item management site and follow these steps:
Select the New Item button on the upper right corner of the screen to create a new item.
Fill in all the needed information
Click Create button to complete.
Create an Item
Edit and Update CMS Item
Sometimes, you want to improve the data of Item in the Entity. To do so, you need to choose an item to be edited first. After that, a pop-up window will be appeared and allow you to edit these item. You just update that items and save it.
For unilingual Bot
Update an item as normally with the language you set up for your bot in the beginning. You can't switch between languages due to the fact that there is only one language chosen.
For multilingual Bot
In order to update an item using different languages, you can follow these steps below:
Click on an item to open the editing window
Click the button Change Editing Language in the right corner of the editing window in Item
Update the item data in other languages
Here is the result. Let's switch between languages to see the difference!
Use CMS in Flow Editor
Data stored in CMS can be inserted into both Blocks and Quick Reply in Flow Editor. CMS Items can be injected in Flow Editor to:
Load data into Block
CMS data can be inserted into most of all blocks that BotStar supports. Here is the guideline for you:
Choose a block that you want to insert CMS data then open the setting site of this block.
In the Property Panel on the right hand side, turn on the option Use CMS Data.
Filter the items to be displayed by tweaking the provided options:
Entity (Required): Choose an Entity from which you extract data to block.
Filters: Create conditions by which items (from selected Entity) are refined to be inserted into block. BotStar supports the combination of various conditions that helps you easily filter the appropriate items. If there is no condition, all items of an Entity will be used.
Query Limit: Show the number of items in an Entity found each time. This option can only be changed in a listing block (Horizontal List or Vertical List). Each listing block includes many items. Each item, after being extracted from an Entity, will respectively be inserted into each block's item. Other blocks are 1 as default so the Query Limit can not be changed.
Sort By: The order of items will be arranged regarding to the field you select. Default field is Created Date (the date you create items).
Order By: Arrange items of an Entity in an Ascending (A - Z) or Descending (Z - A) order of the field you choose in Sort By. Items are set by default in ascending order.
Note: Vertical List Block has a block-level button that can be used to load more items while Horizontal List Block does not. Therefore, if you have more than 10 items, you should use Vertical List Block. However, we do not recommend abusing this as chatbot users should be presented with quick, tailored options.
Map elements of a block with fields of CMS entity after setting up CMS data for a block:
For text elements: Insert CMS data into text elements by using Insert Variables button in the bottom left corner of editing site.
For multimedia element: Insert CMS data into multimedia (audio, image, video) by selecting CMS in multimedia sources, then select the field you need.
Load data into Quick Reply
Select the block into which you want to insert CMS data to open the setting site and follow these steps below:
Choose CMS in Quick Reply to use CMS data
Click Quick Reply element showing up on block
Set up options in the setting site to get appropriate items for inserting into Quick Reply
Entity, Filters, Sort By, Order By (Required) are similar with Load data into Block session instructed above
Max Number of Items: The number of reachable items in an Entity which is equivalent to the number of quick reply buttons listed in block. Up to maximally 11 first items will be shown. The default value of this option is 11.
Insert CMS variables into Quick Reply
Here is the result:
Dynamic Quick Reply
Entity Reference Field
You may face the situation in which some Items of an Entity should link to an Item of another Entity when defining CMS Entites. Thus, these 2 Entities can be considered as having a relationship. The example below will make you clarify this relationship:
Let's assume that we have a chatbot for a laptop store. This store sells laptops from some providers such as Dell, Apple, Asus, etc. Each provider owns different product lines of laptop. To be more precise, Apple has Macbook Air 2017, Macbook Air 2018, Macbook Pro 2018, etc.
Create CMS Entity Reference
We have 2 Entities which are:
Provider (illustrating the list of providers: (Dell, Apple, Asus) includes the Name field which displays the name of a provider.
Laptop (illustrating the list of laptops: Macbook Air 2017, Macbook Air 2018, Macbook Pro 2018, Dell XPS 13) includes Name, Provider. Each item of the Laptop entity belongs to an item of Provider entity:
Name will display the name of a Laptop. (default field)
Provider will show laptop providers. The data type of this field is Entities Reference and this field is refered to the Provider entity. The reason is that each item of the Laptop entity belongs to an item of Provider.
Besides, you can also add the field of Photo, Price to give the detail information for product.
Select the item for association from within the Item Detail form like the picture below once you have set up the Reference relationship between any 2 Entities: Select items for association
Understanding the relationship between Entities and constructing these Entities smartly will make your bot:
Clear, clean and time saving because less blocks are used in Flow Editor
More flexible: Blocks are automatically updated once you make any change to the data in these Entites
Use CMS Reference in Block
This part is to make 2 objectives Provider and Laptop which are mentioned in the section above appear in the block, we need to:
Display items of an Entity based on the user's response to a referred Entity (Display laptops based on user's choice of provider)
Display automatically Items that are added into Entities latterly
Follow these step to accomplish the use of CMS Reference in Block:
Select CMS for Quick Reply to make a list of items of Provider entity
Save the response for this block under suitable name of variable (eg: saved as selected_provider). When user chooses one of Quick Reply buttons, an item of Provider entity which is corresponding to will be saved.
Utilise the variable to filter appropriate items based on the Provider field (field which is referred to the Provider entity) to use Laptop entity
Use Vertical List Block to list items from Laptop entity.
Filter suitable Laptop items based on the response for Text block (Provider field of these items is the response from above Text block)
Filter items of 'Laptop' entity using Provider field
Result: When you select Apple, laptop product line of this brand will be shown. Similarly, if you select Dell, only Dell laptops are listed.
Application of 'Provider' entity and 'Laptop' entity in Flow Editor
Example of Updating CMS Data
Whenever you update the item lists of Provider entity and Laptop entity, the Text Block will automatically update corresponding Quick Reply buttons. It means that when a user selects a Quick Reply button, laptop-list blocks will automatically display suitable laptops. You don't need to make a change or add any other blocks in Flow Editor.
For example, we try adding one more item (Microsoft) into the entity Provider. Meanwhile, add one more item (Surface Pro) which is linked to Microsoft Entity into Laptop entity. These recent changes will automatically be updated in the Flow Editor.
Items of entity 'Provider' and entity 'Laptop' is updated automatically into the flow