Out Of Box Webparts In Page Layout Using SharePoint Designer

Use out of box webparts in page layout using SharePoint Designer SharePoint 0365 / SharePoint 2013:

Requirement

To create a content search webpart which should be accessed along with page layout in all the pages.

Solution


We have created SharePoint out of box content search webpart O365 Online account, tested it in one page, and exported it to .WebPart file. This will give you an xml schema of webpart.

So let's start with creating web part in SP O365 aspx page

Steps 1

Edit Page

Step 2

Create Content Search Webpart

Step 3

Add your required query and template.

Step 4

Export the webpart in .wbpart file and save it in your file system.

The .webpart file will look like shown below.



Now you have to use this webpart in your page layout as page layout so whenever you apply this page layout on any page in the site this webpart will come by default. To achive this requirement please follow the steps below.

Step 1

Open the Sharepoint designer

Step 2

Open the page layout where you want to add webpart that should be your .aspx page

Step 3

Create a div in the page and add a webpart to the page using designer, PFB.

Sharepoint

Step 4

You have to update your newly created webpart in Sharepoint designer using the exported webpart which you have exported in .webpart file in your file system, PFB.

Replace “ with " and replace the DataProviderJSON property Value into designer, This will update your Search Query in the Sharepoint Designer page

Sharepoint

Update the above script into designer page by replacing “with "

Sharepoint

Finally you can update the other properties in the SharePoint Designer such as Title, webpart Template ulr as shown below.

Sharepoint

I hope this will help you to export out of box webpart from Sharepoint O365 site page and import it using Sharepoint designer into Page layout and save you time.