Open all links in a new tab by default

  • 2
  • Question
  • Updated 4 weeks ago
  • Answered
Hi all,

Quick question: is it possible to set all links on a Skuid page to open in a new tab without using a Javascript snippet? Is there a setting I'm overlooking somewhere?

Thanks!
Kathryn
Photo of Kathryn Castle

Kathryn Castle

  • 814 Points 500 badge 2x thumb

Posted 2 years ago

  • 2
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Kathryn,

For button redirects, you can use this setting.


If you are using Skuid themes, I think you can adjust the default 'setting' for links for your app globally.  Otherwise, I think you would need to update the links using JavaScript.

Thanks,

Bill
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
I don't think this is a theme setting.  Pretty sure you need to go to javascript here. 

Here is a community post about this:  https://community.skuid.com/skuid/topics/is_there_an_easy_way_to_make_all_links_load_in_a_new_browse...

But warning....  This will adjust ALL links - even the ones in the salesforce header.  When I've used this script its caused unintended consequences
Photo of Kathryn Castle

Kathryn Castle

  • 814 Points 500 badge 2x thumb
Thanks Rob! Since it was only one link that was causing bother, I wrote a bit of JS to amend that link's behaviour instead of changing all links globally. 

Perhaps a setting you guys could put in for a feature request, though? I wouldn't ask, except it looks like Chrome removed the option to open all links in a new tab by default some months ago too. Although I know there are keyboard shortcuts, it's a shame to have to write JS every time you want a link to open in a new tab. Would be great to be able to configure this.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
IF the field is read only - or is in a field editor you can use a template with href code.  Something like  <a href="/{{{AccountId}}}" target="_blank">{{{Account.Name}}}</div>

Having said that - the enhancement request has been noted. 
Photo of Michael Schniepp

Michael Schniepp

  • 1,808 Points 1k badge 2x thumb
Robs suggestion worked perfectly for me (Having account names link to the account in new tab.) Just make sure the </div> is actually </a> ;)
Photo of Michael Barnes

Michael Barnes

  • 200 Points 100 badge 2x thumb
Worked for me thanks!