In this post, I will explain how we can display SharePoint list in another SharePoint site in the same site collection without reinventing the whole wheel. Briefly summarizing the steps first –
- Open the source site in SharePoint Designer and export one of the views from the source SharePoint list
- Modify the exported file and update the webid of source site in it.
- Upload the modified exported file to web part gallery in the site collection.
- Any site in the site collection can now add the web part which displays the list.
1) Export the List view from the Source SharePoint site
- Open the SharePoint site (that have the list to be displayed in another site) using SharePoint designer.
- Go to the list and open any of the view. In the pic below I have opened ‘AllItems.aspx” page – Select the XSLTListViewWebpart and choose to export it to File. Save the exported (.webpart) file to the file system.
2) Modify the exported file
Open the exported file. By default, you will find that Web ID property (close to line # 59) has a value 00000000-0000-0000-0000-000000000000. Modify this property to the Web ID of the site that has the list.
3) Upload file to the web part gallery
Go to the web part gallery in the site collection. Upload the modified .webpart file to the gallery.
4) Add the web part to any site
Go to any site, edit any page and add the webpart. If you haven’t added it to any custom group, you should see it under ‘Miscellaneous’.
Once done, you will see the SharePoint list as a list view web part. Please note that you can also edit this webpart and change the ‘Selected View’ to display any view created on the source list.