1

I want to show a document library on a site in another site collection.

Is there any other way then using the page view webpart? I've tried with jQuery and the load function but this showed no result, although the load function was apparently carried out ...

I'm using SharePoint 2013 (on premise), isn't there any simple solution for issue?

3 Answers 3

1

You could use the Content By Search/Search Results web part to list documents using search. This will stretch across site collection boundaries if you configure the search query correctly and could be limited to show only documents.

You'd lose the document library functionality (such as the context menu and being able to add new documents) but if all you require is a list of the documents, this would fit the bill.

1
  • I need the document library functionality ... I'm trying now with BDC ...
    – Patrick
    Commented Mar 20, 2015 at 10:34
1

Basically, you create an aspx page in the source site collection that is hosting the library you want to reference. You add a list viewer webpart to this page & use that to show the library, (still in the source site collection). Then from your other site collection where you want to show the library you use a Page Viewer webpart to reference the aspx page from the other site collection.

There are a couple of hoops I had to jump through to get this to work.

First, make sure you are a sharepoint admin with full control of your site collection.

If you don't have Sharepoint Designer, download it here. You'll also need the SharePoint Online Management Shell which you can download here or install in Powershell.

Step by Step…

Actions in Powershell

  1. These instructions will tell you how to install the Sharepoint Online Management Shell and connect to your Sharepoint Site.
  2. To enable the scripting feature in Sharepoint Designer, from a Sharepoint Online Management Shell window type: Run Set-SPOsite -DenyAddAndCustomizePages 0. For more details, please refer here and here.

Actions in the source site collection…

Open your source site (the site containing the document library in question) in SharePoint Designer:

  1. Go to your source site online and click Page on the ribbon
  2. Click the little down arrow under Edit Page and choose Edit in Sharepoint Designer.
  3. It will ask if you want to open Sharepoint Designer, say yes.
  4. It will ask if you want to open the content, say yes.
  5. Sharepoint Designer may ask you to log in at this point. Sharepoint Designer is from Office 2013 and does not support MultiFactor Authentication (MFA). If you have MFA on your account, you'll need to either turn it off or create an app password when Sharepoint Designer asks you to log in.

Actions in Sharepoint Designer...

  1. Click on “Site Pages” in the left hand menu
  2. Click on the small down arrow under the “Page” icon on the top menu ribbon & select ASPX. Give your new file a suitable name.
  3. Click on the name of the file to open it, & then select “Edit File” in the control panel. You should get a warning message that says…”This page does not contain any regions that are editable…..” Just click on “Yes”. At this point you will need to save the file in order to activate some of the controls you will need. So just click on Save in the far top left hand menu.
  4. Place the cursor in between the element tags, & select “Insert”, “WebPart Zone”. (If the webpart zone icon is greyed out, just save the file again.
  5. Move the cursor up so that it is above the closing tag of the “”. Create a new line or two.
  6. Save the file again to activate the Data View icon Select “Insert”, click the down arrow under the “Data View” icon at the top menu.
  7. In the list that appears, you should find the name of the document library that you want to view. Select it & the relevant code will be inserted into your code file.
  8. Save the file & go back to your SharePoint site.
  9. Go to “Site Contents” & select “Site Pages”. In the list you will see the ASPX file you have just created. Select it & you should see a page showing your document library with none of the SharePoint menus & page wrappers that you normally see.
  10. Select the URL of the page from your browser address bar & save it to a txt doc or copy to clipboard.

Actions in the destination site collection…

  1. Go to your destination site collection. (The SC that you want to display the document library)
  2. Find the page where you want to see the document library, or create a new page.
  3. Edit the page
  4. Go to “Insert”, “Web Part”. Select “Media and Content” from the categories menu. Then select “Page Viewer” from the “Parts” menu. Click Add.
  5. Within the Page Viewer webpart click on “open the tool pane”
  6. In the settings window check “Web Page” which is the default & then paste in the URL of the source page that you have just created.
  7. Click, OK, save the page & you’re done! there are other configuration settings you can adjust such as the size & title etc.

Conclusion

This method of displaying a document library across site collections, of even entire farms is a simple yet quick & easy, non-coding fix to get around the problem. Of course, you should also be asking yourself if the document library should be maintained in the location where you want to use it…?

Don’t forget to assign the correct permissions to the source document library else no one will be able to view it.

Additional source here.

0

Unfortunately you can't, you need to select one of the following three workarounds:

  • Custom web part
  • Open it using Iframe and add IsDlg=1 to the end of url (you should consider that maybe user don't have permission on that library)
  • SharePoint content search web part

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.