external links

jack marison asked on November 19, 2018 08:44

There are some pages. These pages are being displayed in menu. Where can I set property that links to these pages have attribute target with value "_blank"?

Recent Answers


David te Kloese answered on November 19, 2018 08:59

What are you using to generate the menu? Is it a custom Web Part?

Do you have developer access to the pages?

0 votesVote for this answer Mark as a Correct answer

Zach Perry answered on November 19, 2018 18:11

I Don't really trust that the Editors will do it correctly everytime, especially if you have WYSIWYG controls. I usually add this js to force all external links to open in a new tab to the master page:

$('a').filter(function() {
  return this.hostname && this.hostname !== location.hostname;
})
.attr('target','_blank')
1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.