(Author: Lightning. Please indicate the source for reprinting)
To make it easier for users, we design the SharePoint website into a hierarchical structure and want users to see the content from the subwebsite on the home page. For example, you want to display the content in a list of the parent website on the homepage of the Child website. This kind of requirement seems quite common, but it is actually not easy.
For convenience, the website where the list is located is called the source website, and the website where the webpart needs to be displayed is called the target website.
The implementation idea is simple: Insert a list webpart on the page of the source website, export the webpart, and import the exported webpart on the target website, then, insert the imported webpart on the page of the target website.
How to export a webpart. First, open the page and enter the editing mode. There is a triangle in the upper-right corner of the webpart. Click it to open a menu and run the "Export" command. The page will pop up to save the webpart file, save it locally.
What if no export command is available? See "Restore exported XSLT List View webpart"
In an episode, in order to use the webpart on other websites, You need to modify the exported file. Open it in notepad. Find the <property name = "webid" node and replace the webid of the source website with the node content. The webid can be obtained through the powershell script below.
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 select the exported webpart when inserting a webpart, You need to upload the exported webpart to the Web Part Library. The address of the web part library is/catalogs/WP /.
Now you can insert the webpart in any website in the same website set!
After being inserted, You can edit the webpart.