One of the things clients often ask us to help with is how to set up links to documents in the best way such that those links will not easily break. This can be an important requirement to consider as often you will find that documents or pages link back to other documents, so moving a document might mean you are forced to change the link to that file in many other locations.
There are two basic ways to link to a document in SharePoint Online, and therefore in Atlas;
- Use the "direct link" to the item. This link is "human readable" by which we mean you can determine the workspace, library, folder and filename of the document. Such a link will have the following format: https://tenantname.sharepoint.com/sites/siteurl/libraryurl/foldername/filename.ext
A user can read the link and understand where the file is stored, but if you move the file the link will break as the folder etc. will no longer be where the file is. - Use a generated link from SharePoint. This link is not human readable - you can determine the workspace but nothing else. However, these links allow you to move the file within the same workspace without breaking the link by using the Move To function in the document library. Note that moving the file manually will not maintain the link. Such a link would have a format like: https://tenantname.sharepoint.com/:w:/s/siteurl/EdyugqzELQtMgTvYiSqLuVoBjDZh6wP5-BmrNcjU2VLCNw?e=9gmsBZ
If you want to move files between workspaces, then neither link will be suitable and any links to such files will need to be manually updated after the file is moved.
Mostly we are documenting this to help you decide which type of links to use when linking to documents stored in Atlas. There is no perfect option so you need to consider whether readability of the links is more important than being able to move the files, or vice versa. If you are confident in the structure of your sites you may decide that you don't need to be able to move the files and use direct readable links.
Get a direct link
To get a direct link to a document is more complex than you might expect as Microsoft obviously want you to use their Copy link functionality, but it can be done.
First, navigate to the library your document is stored in and copy the URL of the library from the browser without the "/Forms/viewname.aspx, so if you have this in the address bar:
Your URL will be: "https://tenantname.sharepoint.com/sites/siteurl/Shared%20Documents".
You will need to use some logic to determine the folders the document is in, and add the folder(s) to the URL, e.g. "https://tenantname.sharepoint.com/sites/siteurl/Shared%20Documents/General/Branding".
Finally, you can right click the document and click Rename to see the filename and extension - just cancel the rename once you have it copied. Add the filename and extension to the end of your URL e.g. "https://tenantname.sharepoint.com/sites/siteurl/Shared%20Documents/General/Branding/DocumentToLinkTo.docx".
Get a generated link
To get a generated link to a page or document, find it in its library, right click, and choose Copy link:
Depending on the security settings in your workspace you may be able to click Settings and change the permissions associated with the link, but the link itself will track the document if it moves within the workspace regardless of the permissions you chose.
Comments
0 comments
Please sign in to leave a comment.