|
1 |
| ---- |
2 |
| -title: Customize default site templates in SharePoint |
3 |
| -description: Customize the default site templates for the SharePoint Team site or Communication site template. |
4 |
| -ms.date: 09/24/2021 |
5 |
| -ms.localizationpriority: high |
6 |
| ---- |
7 |
| - |
8 |
| -# Customize a default site template |
9 |
| - |
10 |
| -SharePoint offers several [site templates that are already available](https://support.microsoft.com/office/apply-and-customize-sharepoint-site-templates-39382463-0e45-4d1b-be27-0e96aeec8398). These are the default site templates and they can be modified by using PowerShell or the REST APIs to control the entire site provisioning experience. For example, you can ensure that your company theme is applied to every site that gets created, or you can make sure a logging mechanism always runs regardless of which site template is chosen. |
11 |
| - |
12 |
| -## Apply a site script to a default site template |
13 |
| - |
14 |
| -To customize a default site template, apply a new template script using PowerShell **Add-SPOSiteDesign** cmdlet or the **CreateSiteDesign** REST API. Specify the **IsDefault** switch to apply the site template as the default template. |
15 |
| - |
16 |
| -| Parameter | Value | Site template type | |
17 |
| -| :------------------- | :------------------- |:----------------| |
18 |
| -| WebTemplate | 64 | Team site template | |
19 |
| -| WebTemplate 1 | 1 | Team site (with group creation disabled) | |
20 |
| -| WebTemplate | 68 | Communication site template | |
21 |
| -| WebTemplate | 69 | Channel site template | |
22 |
| - |
23 |
| - |
24 |
| -The following example shows how to use the **IsDefault** switch to apply the Contoso company theme to the default site templates. The site script referenced by ID contains the JSON script to apply the correct theme. |
25 |
| - |
26 |
| -```powershell |
27 |
| -C:\> Add-SPOSiteDesign ` |
28 |
| - -Title "Contoso company theme" ` |
29 |
| - -WebTemplate "68" ` |
30 |
| - -SiteScripts "89516c6d-9f4d-4a57-ae79-36b0c95a817b" ` |
31 |
| - -Description "Applies standard company theme to site" ` |
32 |
| - -IsDefault |
33 |
| -``` |
34 |
| - |
35 |
| -<br/> |
36 |
| - |
37 |
| -```javascript |
38 |
| -RestRequest("/_api/Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility.CreateSiteDesign", {info:{Title:"Contoso company theme", Description:"Applies standard company theme to site", SiteScriptIds:["89516c6d-9f4d-4a57-ae79-36b0c95a817b"], WebTemplate:"68", IsDefault: true}}); |
39 |
| -``` |
40 |
| - |
41 |
| -### Which default site templates are updated? |
42 |
| - |
43 |
| -The default site template for a communication site is the **Topic** template. The default for a team site is the **Team collaboration** template. When you apply a new default site template, it updates the Microsoft-provided default templates. |
44 |
| - |
45 |
| - |
46 |
| -## Restore the default site templates |
47 |
| - |
48 |
| -To restore a site template to the defaults, remove the site template script that you applied. In the previous example, if the site template created had the ID `db752673-18fd-44db-865a-aa3e0b28698e`, you would remove it as shown in the following example. |
49 |
| - |
50 |
| -```powershell |
51 |
| -C:\> Remove-SPOSiteDesign db752673-18fd-44db-865a-aa3e0b28698e |
52 |
| -``` |
53 |
| - |
54 |
| -<br/> |
55 |
| - |
56 |
| -```javascript |
57 |
| -RestRequest("/_api/Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility.DeleteSiteDesign", {id:"db752673-18fd-44db-865a-aa3e0b28698e"}); |
58 |
| -``` |
59 |
| - |
60 |
| -> [!NOTE] |
61 |
| -> If you're not sure which site template is the default, run the **Get-SPOSiteDesign** cmdlet. It will list all site templates, and indicates which ones are defaults. |
62 |
| -
|
63 |
| -## See also |
64 |
| - |
65 |
| -- [SharePoint site template and site script overview](site-design-overview.md) |
66 |
| -- [Browse and customize Microsoft-provided site templates](https://support.microsoft.com/office/apply-and-customize-sharepoint-site-templates-39382463-0e45-4d1b-be27-0e96aeec8398) |
| 1 | +--- |
| 2 | +title: Customize default site templates in SharePoint |
| 3 | +description: Customize the default site templates for the SharePoint Team site or Communication site template. |
| 4 | +ms.date: 09/28/2021 |
| 5 | +ms.localizationpriority: high |
| 6 | +--- |
| 7 | + |
| 8 | +# Customize a default site template |
| 9 | + |
| 10 | +SharePoint offers several [site templates that are already available](https://support.microsoft.com/office/apply-and-customize-sharepoint-site-templates-39382463-0e45-4d1b-be27-0e96aeec8398). These are the default site templates and they can be modified by using PowerShell or the REST APIs to control the entire site provisioning experience. For example, you can ensure that your company theme is applied to every site that gets created, or you can make sure a logging mechanism always runs regardless of which site template is chosen. |
| 11 | + |
| 12 | +## Apply a site script to a default site template |
| 13 | + |
| 14 | +To customize a default site template, apply a new template script using PowerShell **Add-SPOSiteDesign** cmdlet or the **CreateSiteDesign** REST API. Specify the **IsDefault** switch to apply the site template as the default template. |
| 15 | + |
| 16 | +| Parameter | Value | Site template type | |
| 17 | +| :------------------- | :------------------- |:----------------| |
| 18 | +| WebTemplate | 64 | Team site template | |
| 19 | +| WebTemplate | 1 | Team site (with group creation disabled) | |
| 20 | +| WebTemplate | 68 | Communication site template | |
| 21 | +| WebTemplate | 69 | Channel site template | |
| 22 | + |
| 23 | + |
| 24 | +The following example shows how to use the **IsDefault** switch to apply the Contoso company theme to the default site templates. The site script referenced by ID contains the JSON script to apply the correct theme. |
| 25 | + |
| 26 | +```powershell |
| 27 | +C:\> Add-SPOSiteDesign ` |
| 28 | + -Title "Contoso company theme" ` |
| 29 | + -WebTemplate "68" ` |
| 30 | + -SiteScripts "89516c6d-9f4d-4a57-ae79-36b0c95a817b" ` |
| 31 | + -Description "Applies standard company theme to site" ` |
| 32 | + -IsDefault |
| 33 | +``` |
| 34 | + |
| 35 | +<br/> |
| 36 | + |
| 37 | +```javascript |
| 38 | +RestRequest("/_api/Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility.CreateSiteDesign", {info:{Title:"Contoso company theme", Description:"Applies standard company theme to site", SiteScriptIds:["89516c6d-9f4d-4a57-ae79-36b0c95a817b"], WebTemplate:"68", IsDefault: true}}); |
| 39 | +``` |
| 40 | + |
| 41 | +### Which default site templates are updated? |
| 42 | + |
| 43 | +The default site template for a communication site is the **Topic** template. The default for a team site is the **Team collaboration** template. When you apply a new default site template, it updates the Microsoft-provided default templates. |
| 44 | + |
| 45 | + |
| 46 | +## Restore the default site templates |
| 47 | + |
| 48 | +To restore a site template to the defaults, remove the site template script that you applied. In the previous example, if the site template created had the ID `db752673-18fd-44db-865a-aa3e0b28698e`, you would remove it as shown in the following example. |
| 49 | + |
| 50 | +```powershell |
| 51 | +C:\> Remove-SPOSiteDesign db752673-18fd-44db-865a-aa3e0b28698e |
| 52 | +``` |
| 53 | + |
| 54 | +<br/> |
| 55 | + |
| 56 | +```javascript |
| 57 | +RestRequest("/_api/Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility.DeleteSiteDesign", {id:"db752673-18fd-44db-865a-aa3e0b28698e"}); |
| 58 | +``` |
| 59 | + |
| 60 | +> [!NOTE] |
| 61 | +> If you're not sure which site template is the default, run the **Get-SPOSiteDesign** cmdlet. It will list all site templates, and indicates which ones are defaults. |
| 62 | +
|
| 63 | +## See also |
| 64 | + |
| 65 | +- [SharePoint site template and site script overview](site-design-overview.md) |
| 66 | +- [Browse and customize Microsoft-provided site templates](https://support.microsoft.com/office/apply-and-customize-sharepoint-site-templates-39382463-0e45-4d1b-be27-0e96aeec8398) |
0 commit comments