Hope you are doing fine and safe in this pandemic situation. I recently came up with an opportunity to work with SharePoint Site Designs.
SharePoint Site templates
are now replaced with Site designs in Modern Sites. SharePoint allows us to create JSON schema to apply our
custom options that we want to add.
Below are the things we can apply using site script.
- Create a new SharePoint list
- Define a new site column
- Define a new content type
- Add a navigation link
- Remove a navigation link
- Apply a theme
- Set branding properties
- Set a site logo
- Join a hub site
- Install an add-in or solution
- Register an extension
- Activate a Feature
- Trigger a flow
- Configure regional settings
- Add users (principals) to SharePoint Groups
- Manage guest access
Let us assume we have a JSON schema created. I am taking below sample
from MS documentation for reference.
We will now be adding above JSON schema to SharePoint as Site Script. Below is the command we execute.
$site_script = ‘{
"$schema": "https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json",
"actions": [
{
"verb": "applyTheme",
"themeName": "Contoso Explorers"
},
{
"verb": "createSPList",
"listName": "Customer Tracking",
"templateType": 100,
"subactions": [
{
"verb": "setDescription",
"description": "List of Customers and Orders"
},
{
"verb": "addSPField",
"fieldType": "Text",
"displayName": "Customer Name",
"isRequired": false,
"addToDefaultView": true
},
{
"verb": "addSPField",
"fieldType": "Number",
"displayName": "Requisition Total",
"addToDefaultView": true,
"isRequired": true
},
{
"verb": "addSPField",
"fieldType": "User",
"displayName": "Contact",
"addToDefaultView": true,
"isRequired": true
},
{
"verb": "addSPField",
"fieldType": "Note",
"displayName": "Meeting Notes",
"isRequired": false
}
]
}
],
"version": 1
}’
Add-SPOSiteScript -Title "<Title>" -Content $site_script -Description "<Description>"
How to Apply Site design
to existing site
- We can create a Team Site from Admin center and select our site design while creating one.
- We can apply custom design to existing site using below steps
You can can apply site design using Power Automate, Please refer my blog.
- Click on Gear icon on top right corner
- Select Site Design from Menu
- Select your design template
- Click on “Apply to Site” to apply design to site. You can click on “View Updated Site” once all tasks are completed.
Comments
Post a Comment