📜 ⬆️ ⬇️

SharePoint 2007 - Link library - open a link in a new window

When creating the next portal on SharePoint 2007, it was necessary that the links from LinkLibrary be opened in a new window. Strange, but this option in the standard settings of the web part was not. Searching on the Internet found three main ways to implement this functionality.

Using SharePoint Designer



1. Open the AllItems.aspx page of the desired LinkLibrary in the Sharepoin Designer
2. Select the LinkLibrary web part and convert it to XSLT Data View
image
3. Then right-click to select any link in the web part and select the Hyperlinks Properties option.
4. A dialog box will open. Click the Target Frame button which is located on the right side of the dialog box.
image
5. Another Target Frame dialog box will open. Select the New Window option from the list of goals. Click OK.
Source: www.fivenumber.com/moss-links-open-in-new-window

Opening links in a new window using jQuery


')
In the page header we place this code.
<script src= "http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type= "text/javascript" ></script> <script type= "text/javascript" > $( function () { $('a[href^= "http://" ]') .attr( "target" , "_blank" ); }); </script> * This source code was highlighted with Source Code Highlighter .
  1. <script src= "http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type= "text/javascript" ></script> <script type= "text/javascript" > $( function () { $('a[href^= "http://" ]') .attr( "target" , "_blank" ); }); </script> * This source code was highlighted with Source Code Highlighter .
  2. <script src= "http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type= "text/javascript" ></script> <script type= "text/javascript" > $( function () { $('a[href^= "http://" ]') .attr( "target" , "_blank" ); }); </script> * This source code was highlighted with Source Code Highlighter .
  3. <script src= "http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type= "text/javascript" ></script> <script type= "text/javascript" > $( function () { $('a[href^= "http://" ]') .attr( "target" , "_blank" ); }); </script> * This source code was highlighted with Source Code Highlighter .
  4. <script src= "http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type= "text/javascript" ></script> <script type= "text/javascript" > $( function () { $('a[href^= "http://" ]') .attr( "target" , "_blank" ); }); </script> * This source code was highlighted with Source Code Highlighter .
  5. <script src= "http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type= "text/javascript" ></script> <script type= "text/javascript" > $( function () { $('a[href^= "http://" ]') .attr( "target" , "_blank" ); }); </script> * This source code was highlighted with Source Code Highlighter .
  6. <script src= "http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type= "text/javascript" ></script> <script type= "text/javascript" > $( function () { $('a[href^= "http://" ]') .attr( "target" , "_blank" ); }); </script> * This source code was highlighted with Source Code Highlighter .
  7. <script src= "http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type= "text/javascript" ></script> <script type= "text/javascript" > $( function () { $('a[href^= "http://" ]') .attr( "target" , "_blank" ); }); </script> * This source code was highlighted with Source Code Highlighter .
<script src= "http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type= "text/javascript" ></script> <script type= "text/javascript" > $( function () { $('a[href^= "http://" ]') .attr( "target" , "_blank" ); }); </script> * This source code was highlighted with Source Code Highlighter .


And that's it!
But if users do not have access to the Internet, then all the same it is better to save the jquery.min.js file in the site directory and do not forget to change the link to it.
Source: armsinfragilehands.blogspot.com/2009/02/opening-links-in-new-window-sharepoint.html

Opening links in a new window



Open the file C: \ Program Files \ Common Files \ Microsoft Shared \ web server extensions \ 12 \ TEMPLATE \ FEATURES \ LinksList \ Links \ schema.xml looking for two lines
/> <! [CDATA [">]]>
and change them to
/> <! [CDATA ["target =" _ blank ">]]>

Reboot IIS.

A source:
weblogs.asp.net/bryanglass/archive/2008/03/07/changing-links-list-in-sharepoint-2007-to-open-in-new-browser-window.aspx

There are also several ways
1) Adding an option to the web part (you have to tinker with XSL)
2) Persuade users to hold SHIFT when they want to open a link in a new window.
3) Write your web part with poetess and chess with the option “Open in new window”

Source: https://habr.com/ru/post/70455/


All Articles