Apologies guys, this might be the wrong forum, but I'm posting in desperation !. (Nothing from stack exchange or microsoft). Anyway ...
I am developing a microsoft bot, (currently using bot composer, which is linked to QnA maker). The bot will need to be visible on the main website (which is predominantly a store-front type website, showing various products, with each product having its own URL).
The various questions in QnA maker relate to ANSWERS which need to point to specific product pages on the hosting web site.
The typical scenario will be , user will ask a bot a question, and this will result in an ANSWER which has a URL to the relevant page on the main website. When the user clicks the link in the bot, the main website will navigate to the relevant product page, but the bot should still be visible, and should still be in a state which shows the conversation so far (rather than being re-started).
How can this be achieved?
(I have experimented with embedding the bot in an iframe, as per the Azure bot instructions, but of course, as soon as the parent web page changes, this is effectively a new page so the bot becomes invisible).
NOTE - as a secondary issue, It appears that the QnA maker sets all links to use target="_blank" and I suspect I really need to be using a link which follows this technique: " target="_top">Lin or " target="_parent">Link
Does anyone has any advice regarding this secondary issue? (or any thoughts at all on the above!). Thanks in anticipation
Al Hobbs wrote:you could either have a state for the bot that is given with each request or have a single page app where all requests are done asynchronously
Thanks for taking time to reply Al
So for option 1, I'm guessing the way forward would be :
Bot is sitting in an iframe on product page "X"
User has conversaton with bot, and gets to a point where the bots answer i telling user about product "Y"
When user click the link (which is in the bots answer text), the bots "state" needs to be saved (lets call it state S )
The clicked link will force the "parent" page to re-load with the relevant URL (for a given product "Y").
All of these pages (I guess?) have to have an iframe to hold the bot (usually in the bottom right as it happens).
When the product "Y" page loads, it has the iframe which has the bot in it, and this (iframe/bot) needs to refresh so it shows the state which was current (i.e. state S) , so the user can see the new product page, but also the conversaton in the bot (rather than the bot starting a converstion from scratch).
Does that sound right ?
For option 2 - Is this the basic idea?
- Website is using SPA (Single Page App) philosophy BOT is part of that overall page (again - it could sit bottom right in the overall real estate).
When a link gets clicked in the bot, PART of the page gets refreshed (using Async/Ajax type technology?)
[The part that gets refreshed will probably be the "main" section where the products (X, Y whatver), is displayed, but the bot (and probably the page header, footer, and other stuff, stays as it was.