3

How can I set to open some particular links in new tab(by default) from Global Navigation bar and Link from Link List app.

3
  • Please be more clear- you mean Site settings global navigation
    – Shiva
    May 14, 2015 at 11:56
  • I mean links in the global Navigation bar at home page of any page as well as links with in the Link List Web App
    – cjs
    May 14, 2015 at 11:58
  • is it publishing site? in Global Navigation Bar means, link to subsite or pages on top right?
    – Waqas Sarwar MVP
    May 14, 2015 at 12:08

4 Answers 4

3

Write a script to with quoting classnames. get the classname where ever u want to apply this.

Here is the example

$(function () {    
    $(".classname a").each(function (i) {
        $(this).attr('_target', "blank");
    });
});

Load this script into master page.

3

This article describes an old trick for making certain links open in a new tab. Just append the url for any link you want to open in a new tab with #openinnewtab, and add the following javascript code (master page would be best):

$(document).ready(function() { $('a[href$="#openinnewtab"]').attr('target', '_blank'); });
1

The easy OOTB approach is to edit the page, select the Link tab in the ribbon, check the "open in new tab" box next to the URL. Not sure for a links web part, but you can do the same config in a Custom Links web part.

Good luck!

0

You could specify target='_blank' in the <a> tag. Please refer the this link for details:

1
  • Your answer provides a correct solution to open links in a new tab, however, you should include for the operator information on how to inject the global navigation bar with your Code.
    – SteffPoint
    Oct 1, 2019 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.