Dec 20 2021 02:36 PM
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!
Tim
Feb 02 2022 08:01 AM
May 08 2023 11:56 PM - last edited on May 09 2023 09:44 AM by EricStarker
May 08 2023 11:56 PM - last edited on May 09 2023 09:44 AM by EricStarker
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.