For the convenience of the user, we will design the SharePoint site as a hierarchy and expect the user to see the content from the subsite on the home page. For example, you want to display the contents of a list on a parent site on the home page of a subsite. This demand looks commonplace, but it's not really easy.
To illustrate the convenience, I refer to the site where the list is located as the source site, and the site that needs to display WebPart is called the target site.
The idea is simple: Insert a list webpart on the page of the source Web site, export the WebPart, import the WebPart you just exported on the target site, and then insert the imported webpart on the page of the target site.
How to export a WebPart. First open the page, enter the editing mode, in the top right corner of WebPart has a small triangle, the point is a menu, there is a command "export", the page will pop up to save the WebPart file, first save it to the local.
What if there is no export command? See Restore Export XSLT List View WebPart
For a little episode, to be able to use the WebPart on other sites, you need to modify the files that come out. Open it in Notepad. Locate the <property name= "WebId" node, replacing the node content with the WebId of the source site. WebID can be obtained by using the following PowerShell script.
if (Get-pssnapin | Where {$_. Name-eq "Microsoft.SharePoint.PowerShell"})-eq $null)
{
add-pssnapin Microsoft.SharePoint.PowerShell;
}
$web = Get-spweb Http://chenweifeng
Write-output $web. ID
To be able to select the WebPart that you just exported when you insert a WebPart, you need to upload the webpart you just exported to the Web Part gallery. The Web Part gallery address is/catalogs/wp/.
You can now insert a WebPart on any site in the same site collection!
After you insert it, you can also edit the WebPart.