0

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!

4
  • If I click in the doc lib WP and on the search results page on the document title the preview loads in the original document library. By closing the preview I'm in the doc lib. This is the expected behavior. Are you seeing the preview on the page with the library WP or the search result? Can you explain the exact steps to reproduce the behavior?
    – engineerer
    Dec 21, 2021 at 8:13
  • Both scenarios apply. The steps: 1. New page with DocLib WebPart: I click on the item/pdf. The Preview page shows up (in new tab). Click on the X to close the preview and I end up in the coressponding DocLib of the item/pdf, not the page with the webpart. 2. PNP Search Results: I click on the item/pdf. The Preview page shows up in the same tab. Click on the X to close the preview and I end up in the coressponding DocLib of the item/pdf, not the search results page.
    – sp4ce
    Dec 21, 2021 at 9:11
  • I have the same question. It looks like it's not possible. Have you come up with a solution yet, by any chance? SharePoint Microsoft Community - Question: Using X to close linked documents in sharepoint returns to documents page and not home page
    – DiaPat
    Nov 9, 2022 at 14:49
  • @DiaPat I haven't found a solution for this. In my example I didn't need the library page/view, so I added a redirect script which led the user automatically to the website with the webpart. So they clicked on the doc on the webpart site > doc preview > close > library+redirect > webpart site.
    – sp4ce
    Nov 10, 2022 at 18:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.