BotFramework-WebChat icon indicating copy to clipboard operation
BotFramework-WebChat copied to clipboard

Button orientation in Hero/reciept cards

Open ac-vikram opened this issue 9 years ago • 6 comments

Hello, By default in hero or receipt card, we get the buttons vertically using latest version of botchat.js. But I want buttons side by side (horizontally) in some cards and vertically in some other cards in same application. is there a way that I can send actionOrientation -vertical or horizontal from code behind? Or any other way you can tell that I can show buttons as per my need. Thanks.

ac-vikram avatar Sep 11 '17 07:09 ac-vikram

image

This is image of buttons in horizontal orientation. The same way we can show vertically. please response if there is a way that we can control orientation of buttons while making card and buttons in it.

ac-vikram avatar Sep 11 '17 18:09 ac-vikram

Hi @ac-vikram, you can change your actionsOrientation in the adaptivecards-hostconfig.json file. After you change this value you will need to rebuild your chat.

Keep in mind that all of your cards will have the same orientation. If you need different orientation on a card-by-card basis, you might try creating completely custom AdaptiveCards, where your buttons are in a ColumnSet. Then, each Column can have a SelectAction so that they are clickable and act like buttons.

danmarshall avatar Sep 12 '17 20:09 danmarshall

Hi danmarshall, thanks for your reply. But we are not using Adaptive cards, we are using receipt and hero card only in our application. It would be good if you could tell the solution for receipt and hero card.

ac-vikram avatar Sep 13 '17 06:09 ac-vikram

@danmarshall , that's true. we can achieve that in adaptive cards. But we are using receipt/hero card already for existing functionality as there was no adaptive card introduced earlier . So, it wouldn't be possible for us to make it adaptive from receipt/hero for existing functionality.

ac-vikram avatar Sep 13 '17 17:09 ac-vikram

Hi @ac-vikram, Adaptive Cards are the Bot Framework's way of creating cards for custom scenarios. If this doesn't work for you, then this is why we have provided the source code for you. Feel free to modify the source code to fit your needs.

danmarshall avatar Sep 13 '17 23:09 danmarshall

You may also want to try SuggestedActions which appear as a slide-up drawer at the bottom of the chat.

danmarshall avatar Sep 14 '17 23:09 danmarshall