Вопрос

We're in the process of migrating our intranet into SharePoint 2013. The new site owners have asked for a way to manage links to links similar to links to documents. The ability to link to a document makes them very happy. A couple of groups have a number of external links which change from time to time. These links are referenced on multiple pages throughout their site.

I tried putting all of the links into a links list/app. I then linked to the links list item, just like a document. Unfortunately, this opens up the links item and then the URL must be clicked to get to the target. I had the same problem using the promoted links list/app.

Это было полезно?

Решение

If you're using SharePoint 2013 have you considered using the Promoted Links List and webpart instead of a standard links list?

This functions basically like a links list but includes a basic editable front end whcih allows you so specify clickable icons (defaulting to rather boring blue boxes) instead of text links.

here's how you do it:

  • Create a new App in All Site Contents
  • Select Promoted Links List
  • Populate the list with URLs and Display Titles as you would a standard links list. You will see extra options for launch behavior and display order which are all pretty self explanitory.

  • Once your list is complete go to the page you want to display your links on and Click Edit > Insert > App Part > [Your List Name] and place the list on the page.

You should see a series of blue boxes with text labels which, when clicked, link directly to the URL's you specified in the list.

By default this web aprt only displays horizontally with pagination and the icons are quite large but it is very easily styled with JavaScript in a Script Editor Web Part. This is the most comprehensive guide to styling links that I've found: http://social.technet.microsoft.com/wiki/contents/articles/26522.everything-about-promoted-links-in-sharepoint-2013-change-size-wrap-view-handle-click-event-using-jquery.aspx

Другие советы

Your best bet, IMO, would be to inject a JavaScript code into the display page of the links list. That JavaScript code would grab the hyperlink value, and use it to redirect the browser. If this suits you, we can try to find the best way to
1. inject the JavaScript,
2. and implement that JS code.

[EDIT]
1. Can be achieved by editing the dispform.aspx page and adding a Script Editor Web part in the Web part zone (after the default form Web part).
2. Can be achieved by using this JavaScript API.
   a. Download "spjs-utility.js" from here, and "jquery-1.11.3.min.js" from here.
   b. Add both files "jquery-1.11.3.min.js" and "spjs-utility.js" in a document library of your site (like "Style Library" or else).
   c. In the Script Editor Web part, reference that JS file with a script tag:

<script src='<path_to_jquery-1.11.3.min.js>' type='text/javascript'></script>
<script src='<path_to_spjs-utility.js>' type='text/javascript'></script>

Then, use a code such as:

<script type='text/javascript'>
ExecuteOrDelayUntilScriptLoaded(function(){
    var linkValue = getFieldValue('URL');
    window.location.href = linkValue; // TO BE TESTED: linkValue may contain both the URL and the description (or maybe it's an array?=. Check the value contained in linkValue with the F12 tools, and adapt code accordingly
},'sp.ribbon.js');
</script>

With SharePoint, we use lists and libraries to store data, and we then use "web parts" to present that data out to users. (there's obviously a lot more to it than that, but lets just go with that for the moment)

In your case, you data is your links, and you're storing already storing them in a links list, which is great. So now all you need to do is to use web parts to present them out.

To add a web part, go to the page that you want your links to appear on and edit it. From the insert tab on the ribbon choose to add a web part. In the Apps category you should be able to see your links list. This will add a web part to your page which will display the links from your links list.

Note, this will only work on pages in the same site as your links list, if you need to display them on a different site, you will need to use different web part types such as a Content Query or Content Search web part, which are a bit more complicated to set up.

Use the "Link to Document" content type in a document library list and have other external links point to the link item.

Make sure you use the .aspx at the end of your link when you reference it:

For example, if I enable content type management and add "Link to Document", then add a "Link to Document" with the title "Google" and the url https://www.google.com -- if I provide the link to this item in the form .../Shared%20Documents/Google.aspx, when users click on the link it will direct them to the destination of the link in the item, not the item itself in SharePoint.

I see you tried something similar to this, but I would encourage you to ensure you're using the built-in "Link to Document" site content type from within a Document Library, and make sure you include the .aspx at the end of your link address - we are using this exact technique in a couple of places in SharePoint installations that I manage (2010, 2013, and O365).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top