Forum Discussion
Soheilsd
Jul 29, 2019Copper Contributor
Save as template again!!!
I am wondering if I can save a team site on SharePoint online as a template in a simple way??!! not using the PnP provisioning its too complicated... or is there a complete example of pnp code that...
- Jul 29, 2019Just wondering, why do you consider the PnP provisioning to be too complicated? You are looking for a solution from a Developer's perspective. With the PnP NuGet packages installed in your project, "Save as template" is basically just 1 line of code (web.GetProvisioningTemplate). Applying a template to another site is also just 1 line of code (web.ApplyProvisioningTemplate).
A sample console application using the above techniques can be found here:
https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/provisioning-console-application-sample
For SharePoint Online modern sites you can make use of Site Designs and Site Scripts. You could combine these with PnP provisioning as well.
https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-overview
Hope this helps!
Matti Paukkonen
Jul 29, 2019Iron Contributor
Do you want to save a template from modern or classic team site?
What needs to be included in the template?
Soheilsd
Jul 29, 2019Copper Contributor
modern team site