I have a HTML based candle stick stock chart widget. How can I render it on the chatbot (web channel) as part of the dialog task conversation?
@wslun
As a part of the bot response, you can use the JS editor to format the response using below approved HTML tags.
Tags | Attributes |
---|---|
a | href, title, target |
font | color,size |
table | style,border |
tr | style |
td | style,bgcolor |
div | style |
span | style |
img | src,style,height,width |
h1 | style |
h2 | style |
h3 | style |
h4 | style |
h5 | style |
h6 | style |
Apart from that, there are templates that can be used. If this is not adequate, you can use a custom template to render but that will need modification of the Web-SDK.
Continuing on the above answer -
- If a user tries to same a third party JSON response in the context and the response has anything apart from the above HTML tags, the Platform will not allow saving any such variables/values in the context.
- If any such content needs to be stored in the context for any unavoidable reasons, we recommend double-encoding of the content that has HTML tags. This needs to be done on any third party tool before attempting to save it in the bot or using it in the context. The same content will need to be programmatically decoded before sending out to any other third party.
Example -
"htmlContent": "$253C&2521D0CTYPE%2520html%2520PUBLIC%25208255C%2522-%2 52Fs252FW3C8252Fs252FDTD&2520XHTML&25201......xxxxxyyyyy"
- If your third party call sends an HTML content, we recommend having an adapter service in place, to cleanse the content before it is consumed on Kore Platform.