Open link in new tab or new window ✅

Hi all,

after finally resolving my board issues (through re-installing from scratch and re-importing manually my db now running under mysql), here I am back…

A feature that would, in, my opinion, be really helpful is to have links opening in a new browser tab / new browser window as default behaviour (adding target=“_blank” property to links)

Any idea about how to implement this ? (Maybe a plugin exists already to achieve it and I’ve not seen it ?) Or could it be added to the roadmap for a future release ?
Thanks in advance,
eM

Welcome back!

Sorry, if I didn’t understand your request. But isn’t that a browser topic?
For me here with Firefox:

  • Click opens in same window and tab.
  • Shift-Click opens in a new window.
  • Ctrl-Click opens in a new tab in background (not focused)
  • Shift-Ctrl-Click opens in a new tab in foreground (focused)
1 Like

@emzeweb:
I am not sure what exactly your desire might be, also see that more as a browser issue. But – if you haven’t already done – maybe you want to try:

<a href="http://example.com/" target="_blank">example which opens in new Tab</a>   

example which opens in new Tab


<a href="http://example.com/">example which opens here</a>  

example which opens here


In KANBOARD this will work with installed Plugin ‘MarkdownPlus’

This doesn’t affect the internal links from KB, e.g., to display a task from the board display.

And BTW, even I have the MarkdownPlus plugin installed as well, I’m quite sure it doesn’t alter this behavior.

hi,

sorry if I wasn’t explicit enough in my request. my idea was to find a user-friendly way (i.e. addition in the formatting shortcuts bar, or change in the default behaviour) to make external links open in new tab.
but as you pointed out, this is more a browser usage question, and I guess I’ll just have to make the board users get the habit of ctrl-clicking the links…

thanks for reminding me of the possibilities offered by the browser itself…

as far as Markdown Plus plugin is concerned, it won’t help me here since the end-users of our kanboard are not used to writing html…

2 Likes

the user friendly way, would be to force the behavior, by overriding the template that creates the behavior.

although now im confused:

as far as i can see, it has target = “_blank”

Yes, whatever you add explicitly as external link to a task, will get opened detached. But there are many other links within KB.

well, yeah, I get what you mean by adding a URL “explicitly as external link to a task” but it’s definitely not the way we do it… I was thinking about the links that are included in the Task Description… but it’ll be alright with ctrl+click. thanks for looking into it anyway.

1 Like

oh, so you want the links in the Description to open in a new tab. That runs through parsedown. that is easy to do.

add 'target' => "_blank", after line 1421. Should do the trick.

If you want more stuff to open in a new tab, there really are only a handfull of places links get interpreted, so its not hard to get them all.

1 Like

and 90% of them run through parsedown. 90% is arbitrary, i made that up, but definately “most” links are handled through parsedown. might even be 100% if we are strictly referring to commonly made user links.

And between parsedown and the UrlHelper, might be close to 100% absolute.

Here all you need to do is make the default $newTab value true.

hey, @creecros, thanks a lot ! this seems to do the trick !!