What you need to know about links to files and pages in SharePoint
A customer recently told me that although I had urged her to use “Copy link” with “People with existing access” to link to a document on a SharePoint communications site, she determined that it was better to select the Document path. – because the links did not break when the documents were renamed. I did a few tests, saw something different than what she was seeing and concluded … that we were both right!
When we got together to compare the reasons why we saw different results, as I expected, there was something different about what we were doing. Turns out we weren’t testing with the same type of document or browser. I was surprised to learn some new SharePoint link superpowers, but I was worried because, in the end, choosing the right way to type a link to a document depends on several factors. Fortunately, you don’t need to remember all of the use cases we’ve tested because there is a straightforward approach that will work consistently to deliver the best user experiences.
Specifically, we found that the behavior of links is based on:
- Browser (Edge vs Chrome)
- Web Part (Quick Links vs Text Hyperlink)
- Document type (PDF vs native Office file)
- Location (site where the document resides and where you make the link)
The scenarios are complex and nuanced, but here’s the gist.
On your website, use the Quick Links web part if you can. For any type of file, use the Quick Links web part to navigate to the file and add a link to the file if it resides on your site. (Be careful when using the Quick Links web part. If you Download a document from that web part, you might not be able to find it easily because it will be stored in the site assets, in a folder with the same name as the page title. It will not “live” in the Documents library, where publishers and others might expect to find it. I always recommend that you upload your documents to the library or folder where you want to keep them first. After downloading the file, use the Quick Links web part to navigate to the file.)
Why use this approach? If you move or rename the file, your links won’t break!
For native office files, use Copy link> people with existing access can use the link to copy a link to a document and add it to a text hyperlink or Quick Links web part. It doesn’t matter if you use Share or Copy Link; both methods give you exactly the same experience. But it’s a bit more work to use Share unless you’re trying to email a file link. If you just want to link to a file, use Copy Link. If you want E-mail a link, Share saves certain steps.
Why use this approach? If you move or rename a document and have used this type of link, the links in your document will not be broken. (The same goes if you link to documents from another site!)
For PDF files, copy the document path, and add it to a text hyperlink or Quick Links web part. You can find the Path link by clicking on the document information panel, scrolling to the bottom of the attributes, and clicking the icon next to the Path.
Why use this approach? If you move or rename the file, your link will not break if you are on the same site, but it will break if you link from another site.
For pages, the experience is the same in Chrome and Edge. Renaming the title of a page does not affect the URL of the page. So, Title updates will not affect the links to the page. The only action that affects the links is to rename the file name for the page. You can rename the title of a page without renaming the URL of the page. Unless there is a major disconnect between the title and the page filename, you may want to limit changes to the filename of the pages.
For pages, use the path to link. The fastest way to get the path is to open the page and grab the URL. However, you can also get the path from the site page library using the same method as if you were getting the path to a file.
Why use this approach? The links to the page in the navigation or web components of your site will not be broken if the file name is changed. However, all links from other sites to the page will be broken if the file name is changed.
Other web parts
These experiences are browser independent. I’ll explain the implications in the recommendations below:
Link to a file using the File Viewer web part
- Select the file in the web part if the file resides on your site. If you choose an Office or PDF file in the web part, you can rename and move the file around the site, and your link will still work.
- If you are viewing a file on another site, you can choose either the path or the copy link for any type of document. Both links will resolve to the new name or location if you rename or move the document in the source site.
Link to a view of a document library
- The Document Library web part on your site. You can rename the view URL or the view title, and your web part will still work.
- Quick Links web part. You can rename the view URL or the view title, and your web part will still work.
- Links to a view on another site. Changing the title of your view will not affect the link. If you change the URL of the view, the link will break.
Want all the details?
I’ve created detailed tables that explain all the different browser, web part, and link type scenarios. To explore, see my “Link to Files and Pages in SharePoint Online” document.
Copyright © 2021 IDG Communications, Inc.