Open external links in new browser tab


  • Translator

    I think it would be positive that external links would open on a new tab instead of opening in the active tab of the browser, so for example the user does not need to press return one they open an external link present in a topic (for example to reply in consequence).

    Maybe this functionality is already present and I just didn't see it? If it is not the case, what do you think about it?

    Regards.


  • Global Moderator

    It could be easily added. Just add target="_blank" to links matching a regexp like this: /((http|https):\/\/(?!www.google.co.uk)[\w\.\/\-=?#]+)/


  • Translator

    @pitaj yes i was thinking on something like you've pointed out. In fact because i think it would be pretty simple to include and in my opinion it would increment the forum usability.

    If it is not included in the core, i'm planning on getting started with plugin development with a little plugin implementing it.

    Thanks for your reply :smile:



  • I believe that if you go in your profile in the set up page, the first box and option of that page is to force links to open in a new tab.
    It would be nice to set up that option as default from the admin panel, but for now that works well.


  • Translator

    @TaLoche said:

    I believe that if you go in your profile in the set up page, the first box and option of that page is to force links to open in a new tab.
    It would be nice to set up that option as default from the admin panel, but for now that works well.

    You are completely right. Thanks for your response. No need for new functionality as it is already present. Only the default aspect of it you pointed out, from the admin perspective.

    Thanks again.



  • Is there any way to set this globally for all users?



  • @PitaJ Where would this be added? In a template?



  • @codecowboy

    Isn't it just an option in the admin panel



  • Yep this is a global option in /admin/settings/user#default-user-settings

    0_1460524770594_Screen Shot 2016-04-13 at 06.16.41.png


Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.