0

I have to create a custom Link List containing a column which if it is checked the link will be opened in a new page (new tab in IE). How can I solve it? thanks.

1
  • Could you possibly use the built in Promoted Links list? It has what you need :) Commented May 21, 2014 at 13:21

5 Answers 5

1

Similar questions is asked here:
How can you have SharePoint Link Lists default to opening in a new window?

You can edit the page in SharePoint designer, convert the List View web part to an XSLT Data View. (by right click + "Convert to XSLT Data View"). Then you can edit the XSLT - find the a tag and add an attribute target="_blank"

3

You can write a javascript function to solve this.

    <script type="text/javascript">
    $(document).ready(function(){

     if("your condition")
     {
    $('.s4-ba a').attr('target', '_blank');
     }
    });</script> 
1

I followed Aanchal's example though I needed a few other things to get it to work right. I needed to add a reference to jQuery, than I needed to find the proper styles to apply my changes to. I was displaying a really old filtered list from a WSS3 site Upgraded to SP2013. So I needed top open in a new page and change the Font/size of the text.

ms-vb2, ms-vh-div and ms-headerSortTitleLink are the CSS Classes that needed to be found and altered.

This is what I ended up with.

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){

      $('.ms-vb2 a').attr('target', '_blank');
      $('.ms-vb2 a').attr('style', 'font-family: Arial; font-size: 13px');
      $('.ms-vb2').attr('style', 'font-family: Arial; font-size: 13px');
      $('.ms-vh-div').attr('style', 'font-family: Arial; font-size: 13px');
      $('.ms-vb2 td').attr('style', 'font-family: Arial; font-size: 13px');
      $('.ms-headerSortTitleLink ').attr('style', 'font-family: Arial; font-size: 13px');
     });</script> 
0

You can take this code, save it to a text file, upload to your SharePoint site. On the page, use the Content Editor Web Part and paste in the link to the text file on SharePoint in the dialogue box. Go to layouts and flag the Web Part as hidden. Now all links on this page will open in new tabs. I just did it in SharePoint 2010, and I would bet it works in 2013 too.

<script type="text/javascript">
$(document).ready(function(){

 if("your condition")
 {
$('.s4-ba a').attr('target', '_blank');
 }
});</script> 
-1

Better solution using XSL here. http://valygreavu.com/2014/11/27/customizing-the-links-sharepoint-app-to-open-links-into-new-window-using-xsl-link/

1
  • Please don’t add just a link as answer to a question. If the link breaks, the answer you provided will not be useful for future visitors. Provide an answer of your own and use the link as reference. If needed, you can block quote the content from your link. More information is found in our help center, especially How do I write a good answer
    – Benny Skogberg
    Commented Nov 28, 2014 at 12:01

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.