0

Is there a configuration in the bot framework that makes it open links in a seperate tab?

Looking at this link, seems there is no way to specify in markdown to open a link in a new window and that it is possible using html.

We do not want to specify that long HTML configuration in each link, and we cannot call a function that does that because some of the links appear as a prompt which expects const only (so calling a function is not possible).

Therefore, we are looking for some general configuration in the bot frameowrk that would make links appear in a new window.

Community
  • 1
  • 1
Ravit D
  • 907
  • 9
  • 27

2 Answers2

1

There is a class in bot framework named CardAction.

If you want to open some link, you should have something like this :

List<CardAction> listButtons = new List<CardAction>();
listButtons.Add(new CardAction
{
  Value = "https://google.com",
  Type = "openUrl",
  Title = "open google",
});
Bob Swager
  • 884
  • 9
  • 25
  • Thanks for the answer. What I'm looking is a setting in bot framwrok so that links open in another window by default – Ravit D May 11 '17 at 11:14
  • Can you provide more explanation what you are trying to do ? – Bob Swager May 11 '17 at 11:16
  • When writing a regular context,PostAsync message I want links like this one: [text](https://url) to be opened in a new tab – Ravit D May 11 '17 at 13:00
  • You can't insert links into any messenger channel. You must use CardAction instead. Please mark this question as answered. – Bob Swager May 11 '17 at 13:01
1

Links should open in a new tab by default. There is a GitHub issue tracking this here: https://github.com/Microsoft/BotFramework-WebChat/issues/454

Here is the PullRequest that fixes the issue: configure MarkdownIt to open links in new tab

Eric Dahlvang
  • 8,252
  • 4
  • 29
  • 50