Is there an easy way to make all links load in a new browser tab?

edited June 26, 2020 in Questions
I want to always keep my nice Skuid page with a reference table open, and when I click on record links I want them to open in a different/new tab. Is there any way to do this without manually overriding each column in my table with a template containing a custom URL?

Comments

  • edited June 26, 2020
    Peter, Depending on your operating system/browser there is usually a key you can press to do this... on my mac, in chrome, its command + click on the link
  • Anna WiersemaAnna Wiersema 🛠️ 
    edited December 13, 2019
    Hi Peter, you can try this at the page level by including this javascript snippet in your page. (function(skuid){ var $ = skuid.$; $(function(){ $('head').append( $('<base target="_blank">') ); }); })(skuid);
  • edited December 13, 2019
    I added this as a snippet on my page, but it didn't change the functionality of the links on my page. Links still open in the same tab.
  • Anna WiersemaAnna Wiersema 🛠️ 
    edited December 13, 2019
    Hmm.... I just tried this as an Javascript Resource (type = in-line) and it worked fine.
    (function(skuid){      var $ = skuid.$;      $(function(){          $('head').append(              $('base target="_blank"')          );      });  })(skuid);
  • Anna WiersemaAnna Wiersema 🛠️ 
    edited November 23, 2015
    Also, you should use the Inspect Element feature on your browser to see if this code actually got correctly appended to your page.
  • edited December 13, 2019
    I see the following code in the script section of my rendered page, but the links still open in the same tab. Perhaps there's a browser setting that's overriding this? (function(skuid){ var $ = skuid.$; $(function(){ $('head').append( $('base target="_blank"') ); }); })(skuid);;
  • Anna WiersemaAnna Wiersema 🛠️ 
    edited November 23, 2015
    ughhhh the code editor here is messing things up. it's supposed to be '<base target="_blank">' is that what you had?
  • edited January 29, 2018
    No, it wasn't, but now I've changed it to to the following, and now it does work: (function(skuid){ var $ = skuid.$; $(function(){ $('head').append( $('<base target="_blank">') ); }); })(skuid); Thanks!
  • Anna WiersemaAnna Wiersema 🛠️ 
    edited November 23, 2015
    no problem! sorry for the confusion and glad it's working now!
  • Kaede HollandKaede Holland ✭✭✭✭
    edited August 5, 2014
    Should this work for the "On-Click URL" on photo views of a table?
  • edited September 9, 2016
    Thanks so much!
  • edited March 16, 2017
    Woah! Thanks for sharing this! 
  • edited March 16, 2017
    Ohh it's working in classic but not in lightning

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!