Sharepoint designer solution: http://blog.sharedove.com/adisjugo/index.php/2011/06/26/setting-a-link-target-in-the-sharepoint-2010-data-view-web-part/
Lot of other possibilities: http://www.sharepointdiary.com/2011/02/sharepoint-link-list-open-in-new-window_21.html#ixzz2aWtiNarl
I liked the java script one very much, might be bit tedious but works like a charm.
You can Make Selected Links in a Links List Open in a New Window with Little JavaScript and content editor web part. Here is how:
when creating links in the Links List, add #openinnewwindow on the end of each link that you would like to open in a new window.
Add the content editor webpart, and place the following code in it:
Lot of other possibilities: http://www.sharepointdiary.com/2011/02/sharepoint-link-list-open-in-new-window_21.html#ixzz2aWtiNarl
I liked the java script one very much, might be bit tedious but works like a charm.
You can Make Selected Links in a Links List Open in a New Window with Little JavaScript and content editor web part. Here is how:
when creating links in the Links List, add #openinnewwindow on the end of each link that you would like to open in a new window.
Add the content editor webpart, and place the following code in it:
<script language= "JavaScript" > _spBodyOnLoadFunctionNames.push( "PrepareLinks" ); function PrepareLinks() { //create an array to store all the anchor elements in the page var anchors = document.getElementsByTagName( "a" ); //loop through the array for ( var x=0; x<anchors.length; x++) { //does this anchor element contain #openinnewwindow? if (anchors[x].outerHTML.indexOf( '#openinnewwindow' )>0) { //store the HTML for this anchor element oldText = anchors[x].outerHTML; //rewrite the URL to remove our test text and add a target instead newText = oldText.replace(/ #openinnewwindow/,'" target="_blank'); //write the HTML back to the browser anchors[x].outerHTML = newText; } } } </script> |
Comments
Post a Comment