SharePoint Online file preview page always redirects back to library - chance of custom backlink?

Copper Contributor

Hey everyone!


In a SharePoint Online modern library you get a preview page with clicking on a PDF file. This is a very cool feature so far. But the moment you click on the X to close this online viewer, you always get back to the original document library.


You were on a custom site with library webpart? > Original document library.

You were on a search result page? > Original document library.


How can I deactivate this - or in other words, how can I define a custom backlink/parent?


I already tried manually changing the ?parent= parameter to the search result page, but this only throws an "UnableToDetermineInitialItem" error.


Any ideas?


Thanks and kind regards!


2 Replies
Any ideas on this? Having the same need. Thank you!

Unfortunately, it is not currently possible to define a custom backlink (external link removed by moderator) /parent for the SharePoint Online file preview page. The behavior you are experiencing is by design, and there is no supported way to change it.

Manually changing the ?parent= parameter is not a supported method and can lead to errors, as you have already experienced.

If you need to navigate back to a specific location after previewing a file, you could consider opening the file in a separate window or tab instead of using the preview feature. Alternatively, you could add a link to the desired location in the file's description or metadata, so that users can easily navigate back to it after previewing the file.

It's also worth noting that Microsoft frequently updates SharePoint Online with new features and functionality, so it's possible that this behavior could change in the future.