Sometimes you have external content that you would like to make available from your document library without uploading a file. Examples include documents in other SharePoint sites or libraries, and even links to other web pages including SharePoint pages and external web sites.
Turns out SharePoint already has this built-in, just well hidden. There is a built-in Content Type called "Link to a Document". Just add this to your library and then just click the "New" dropdown and select "Link to a Document"! It will simply ask you for a document name and url. You can supply a URL to anything that starts with "http://", including both SharePoint documents and external web pages. It does not support a link to a network share such as "\\myfileserver\folder1\somedoc.doc".
- Display your library (Example: Shared Documents)
- Click Settings and Library Settings
- Click Advanced Settings
- Check "Allow management of content types" and then OK
- In the Settings page scroll down to Content Types and click "Add from existing site content types"
- Select "Link to a Document", click Add and then Click OK
- Go back to your library and click the New dropdown and select "Link to a Document"
- Enter a display name (Document Name) and the URL (must start with http://) and click OK
- Basic Page
- Web Part Page
- Dublin Core Columns (Do a web or wikipedia.com search for "Dublin Core")
- Picture
You can also add customized folders to the New dropdown. See here. Need to add custom columns / meta data to any of the above? Just create a new Content Type based on one of the above and add it to your library. See here.
.
65 comments:
Solved my quandary perfectly! Thank you!
Hi, thanks for the post, is it possible to access the metadata using the link that we have added by using this process.
Anonymous,
Not by using this option. But I think you could write one to do so. (something to put on my todo list!)
Mike
Yes, you can have a link with metadata, but you have to ditch the predefined option and create one yourself.
Here is where I got the info to add metadata to Links to Documents: http://www.toddklindt.com/blog/Lists/Comments/ViewComment.aspx?ID=226
Thank you thank you! been wondering about this for ages.
Wow. I fumbled around Microsoft's "help" pages for about 15 minutes before I went back to Google to search again. Up popped your post and it showed me exactly what I needed to do. Thanks!
Thanks Mike, works a treat. It also allows you to link to other folders!
I do not have the "settings" option on my menu. Just "new", "upload", "actions" options.
Do I need different authority from my admin area?
CJ
> I do not have the "settings" option on my menu. Just "new", "upload", "actions" options.
You have "Member/Contributor" permissions. You will need "Designer" or "Owner/Full Control" permissions to see Settings.
Mike
Perfect !!! Thanks for this post and it worked well for my requirement.
Finally!! Thanks for the information. Just what I have been looking for.
My problem is that the documents are on a media server where the link does not start with http. Is there a way to link to a file that starts with mms://?
> Is there a way to link to a file that starts with mms://?
Yes.
1) use notepad to create a text file named redirect.htm (or any name you choose that ends with .htm)
2) In this file add this little JavaScript routine
<script>
window.location.href = window.location.search.substring(1);
</script>
3) upload this file to a library in SharePoint and note the URL (something like http://yourserver/sites/yoursite/shared documents/redirect.htm)
4) When you add a new Link to Document enter the URL this way:
http://yourserver/sites/yoursite/shared documents/redirect.htm?mms://pathtoyourdocument
Mike
Thanks! I will try that
Perfect.. exactly what I wanted. Thanks.
Hi Mike, yet another SharePoint newby you have solved a problem for (site deserves to be top of Google etc)
Is it possible to get links in document libraries to open in a new window?
TheGoat,
> Is it possible to get links in document libraries to open in a new window?
Yes. It would be a variation of this article:
http://techtrainingnotes.blogspot.com/2009/07/sharepoint-adding-popups-to-link-lists.html
I'll see if I can put together a new article to add "Open in new window" to a document library.
Mike
Does the above "adding hyperlinks" function only work with the non-free version of sharepoint?
Anonymous,
Yes it is in both WSS and MOSS and in Foundation 2010 and Server 2010.
Mike
Mike -- You're the best. Thanks for the post.
Thank you for the post. Quick question. I do not have a multimedia server, just a data server. Is there a way to link documents that are stored locally: //myserver/folder/doc.doc
Anonymous,
Link to a Document will only work with URLs that start with http:// or https://
You could create a web page using notepad and save it with an ASPX extension (mydocument.aspx) to a SharePoint library. The page would only have the following content:
<a href="#" onClick="history.go(-1)">Return to the library</a>
<script>
document.location="file://DEMO2010A/SampleDocs/adventureworksbikes.xls"
</script>
You would need to create one of these files for each document you want to link to.
Mike
Mike,
That's what I figured. I will look into your solution. Thank you again. Cheers!
Hi Mike,
I get a message that says "The specified item or folder name is too long. The URL path for all items and folders must be 260 characters or less (and no more than 128 characters for any single item or folder name in the URL). Please type a shorter item or folder name."
I copied/pasted the link to the site where my other reports are located...is there a way to shorten the link and still get to the same webpage?
Excellent clear instructions. Answered my question perfectly.
Shar
Nice post!
I was wondering though if you can use this same option but then having the document opening in Edit mode.
Any ideas?
Br,
Mark
Mark,
I'm working on an article on how do duplicate all of the menu links, and I may have found a way to do what you want, but it will be a week or so before I can document and post that. Check back...
Mike
Great post, but be aware the redirect code doesn't appear to work in FireFox, i.e.
window.location.href = window.location.search.substring(1);
This does not work for me it opens an excel spreadsheet, any suggestions?
I have tried inserting the link at the top of the spreadsheet where it asks for a URL and a name and it does show up in the properties?
CH,
You added the Content Type to the library, added a New Link to a document, entered the URL to your Excel file in another library or site and then clicked the link?
What did you want it to open if not the Excel file? (I may not be understanding your question...)
Mike
Wondering if there is any way to make these links to documents/folders work in Windows Explorer? I get an .aspx webform file there instead of a useable link. Would love to have my links work in explorer as well...
Nick,
No way I know of. A library stores files, and the Link to a document feature creates an ASPX file that includes redirect code. So all that is seen by Windows Explorer is the ASPX file.
Mike
Awesome. Thanks for the help.
Hi
I use SharePoint 2007 and am trying to create links to documents elsewhere on the site, I.E from one document library to another. The only option I get though is to link the document library - not the actual document itself. Is it possible to do this, or can I only link the library?
Thank you,
Stacie,
Just go to the document library and right-click the document you want to link to, click Properties, and copy the complete URL. Paste this URL into the new Link To A Document item.
Mike
Hello All,
you can link your server file's also using edit properties option. there u have to change http to file. example File://J:\Hello\hello.xlsx
Hi, I have a document library with several folders in side. When I try to create a link in one of those folders in the library, it is created or referenced in all the folders. is there a way to just have the link in one folder instead on all to folders?
F. Hilman,
> When I try to create a link in one of those folders in the library, it is created or referenced in all the folders.
"Link to a Document" is just an ASPX file that is added to the library or a folder within the library. I can't think of any way it would show up in another folder.
Mike
I would like to add a web part which shows the graphics of the URL site on sharepoint without actually re-directing to the site. Is this possible?
Anonymous,
> without actually re-directing to the site
If you just want a web part to display an image or a page, use a Page Viewer web part or use a Content Editor Web Part and add the HTML for an IFRAME.
Or do you want to click a link in a document library to display the image?
Is there any way to to file the link with column headings created on the page? It doesn't give me an option and then the link doesn't group in the grouping settings I have set up for the page.
Anonymous,
You can add meta data columns to the Link to a File item. Link to a File is a Content Type, so you can make a copy of it and add columns.
Go to your top level site.
Go to Site Actions, Site Settings, Content Types.
Find the Link to a File content type, copy it and add the columns needed.
I am unable to open .aspx files in a doc lib post migration to SP 2010.All the other files are coming up fine like word, excel, pdf.
Only a blank page opens up when clicked on the .aspx file
> I am unable to open .aspx files
No error at all? Is there anything in the SharePoint or Windows event logs?
What happens when you create a new Page or Web Part Page in 2010?
Did the pages use a custom master page when in 2007?
You may want to post your question here: http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010setup/threads
Mike
Thanks so much Mike! Your instructions are very clear and helpful. I've been wondering how to do this for months and thrilled to find out how finally!
I have sharepoint foundations 2010 installed on windows home server 2011. How can I access the whs 2011shared folders in sharepoint foundations? Do i have to build a hyperlink to every document in the share?
Thanks
Gregory,
I have not used WHS so I have no idea! :-)
Try posting your question in the TechNet forums for WHS or SharePoint 2010.
Mike
Hi Mike - If a person is using Safari to access an Intranet site (SharePoint 2007, MOSS), what is the syntax to enable Safari to open an Excel file (located on a network share)? In SharePoint I have tried the following link File://ServerName/FilePath/filename.extension. In Internet Explorer this path works fine when opening the Excel file but the Excel file does not open when clicking the link from Safari. Any help you could give would be greatly appreciated. - Jodi
I don't use Safari, so I can't test one way or the other. In any case I don't think SP 2007 is very friendly with non-IE browsers. SP 2010 and 2013 are much better across browsers.
Did you try using http?
http://ServerName/FilePath/filename.extension
This tutorial was so helpful. I struggled to solve this problem for quite some time via MS help. THANK YOU!!!
I created a link to another site on my server. I used the (Click here to test) and it worked perfectly. However, when I click the link from my library it takes me to a blank site. That according the bread crumbs is a blank site under my library. Any ideas?
Thank for your tips, but when I click click new link, it always prompt upload document windows. Please help
Hi Mike.
Great explanation. Simple and to the point.
Follow up question for you - If I have added the Basic Page content type to my Document Library, how do I go about modifying the appearance of the Basic Page template? I'd like to have some formatting such as the Quick Launch bar on the left side and the Text Layout button on the ribbon.
Any advice?
I know this was not an option enabled by default for me.
This blog post show how to do better than I can explain.
http://aaclage.blogspot.com/2011/09/how-to-add-links-in-document-library.html
This works great and allows us to create a central library of important stuff. Thanks for the info.
Hi Mike,
Thank you for being so well versed on this feature. I am looking for a variation to this solution. I would like the new item list to link to a document where the location is a fixed network address (so the users don't need to know the path-it is already provided). Essentially the template for a file is located elsewhere and I don't want it duplicated in this library. I tried to add the .ASPX file as the template however it opens my default web editor (SharePoint Designer) when selected. Any suggestions?
Thanks,
Paula
Sorry if this appears twice. after signing in with Google my comments box reappeared empty.
Brilliant article Mike. Solved a huge problem for me. Do you know if it is possible to apply this to the root of a site and have it update all document libraries underneath and/or any new libraries created
Rick,
No. Content Types need to be added to each library individually.
One option: Write a PowerShell script that scans all of your libraries and if the Content Type is not there, add it.
As far as new libraries, you can add the Content Type to an existing library, save it as a template and then ask site owners to create new libraries from that template.
Mike
Brilliant!!!
(I was attempting to upload a shortcut!)
Dude you just saved the fricken day! Thank you !!
Thank you very much for all of this!
The "link to a document" portion was perfect!
As Ringo would say . . . "Peace & Love!"
Is there a way that, once you've got your link etc. done, you can make the page open on itself rather than in a new tab?
Ed,
> make the page open on itself rather than in a new tab?
Not directly to the Link to a Document Content Type, or to a single Link to a Document link. You could edit the view's page in SharePoint Designer and add some JavaScript that changes the link behavior. Let me know if this is of interest, and I'll look into it.
Mike
Hi Mike,
I used your post to add the type Wiki enterprise page. It is now visible in the drop down under New Document but I get an error, this is the content
"Error
An unexpected error has occurred.
Troubleshoot issues with Microsoft SharePoint Foundation.
Correlation ID: 3a7bada7-e0fd-47bc-9bc9-c1c906cf533d
Date and Time: 11/25/2017 9:13:43 AM"
What do you think I should do?
Thanks a lot!
Igor,
Tell me more about your SharePoint:
version: 2007, 2010, 2013, 2016, SharePoint Online, SharePoint Online Modern UI?
edition: Foundation, Standard, Enterprise?
Anything custom in that library? Event receivers, workflows, other content types?
You could send the Correlation ID and Date and Time to your server admins so they can lookup the error.
Mike
Post a Comment
Note to spammers...
Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.