Recently I had a colleague looking into an issue with Promoted Links not opening into a new tab in SharePoint 2013. So I thought I will look into it and see how it could be fixed using a bit of JavaScript.
To test this problem I have created a Promoted Link called My Links and added two items. Create an new item for a link to google.com and bing,com web site:
When you click on either one of the tiles it will open a new tab, don’t close the tab and return to the tab where the Promoted Links were. Now click on the other tile and you can see that it open in the same tab as the previous tile.
Note: This issues reproduced in Chrome, and some older IE browsers. Without the fix I can get it working perfectly in Window Edge browser in Windows 10.
Upon inspecting the page source for the tiles you can see the markup has a bug where the target attribute value has two equal characters. It seem that this is a known issue in SharePoint 2013.
To resolve this we are going to use jQuery to make the changes to DOM. So you will need to download a copy of jQuery from their web site and save it to your Site Asset folder. I created a sub folder called scripts in my Site Asset folder and uploaded the file there:
Now go back to your Promoted Link list and edit the page and insert a Script Editor web part and copy and paste the following code below:
<script type="text/javascript" src="/SiteAssets/scripts/jquery-1.11.3.js"></script> <script type="text/javascript" > $(document).ready(function() { var tiles = $(".ms-promlink-body").find("a[id*='Tile_WPQ']"); if (tiles.length > 0) { tiles.each(function(){ if ($(this).attr("target") === '="_blank"') { $(this).attr("target", "_blank") } }); } }); </script>
So what the code does is select all the anchor element with an id containing the text “Tile_WPQ”, after have all the elements back we iterate through each one and check if the target attribute is equal to “=’_blank'” and then we reassign it with the correct value of “_blank”.
Now reload your page and see it work, and I hope this post is informative and useful!