⚙️How to create custom site templates in SharePoint
HTML-код
- Опубликовано: 7 июн 2024
- In this video tutorial, you’ll learn how to create a custom site template in SharePoint to start from a solid structure saving time.
We'll see how to use Site Design & Site Script to generate a catalog of custom templates for your organization that anyone can take advantage of.
I'll show every step in this tutorial using PowerShell and Power Automate.
🔗Link to the solution on my GitHub repository:
github.com/giuleon/CustomSite...
🔗Official Microsoft docs about Site Design and Site Script
docs.microsoft.com/en-us/shar...
👇
🔔Don't forget to subscribe to my channel to stay tuned Subscribe: ruclips.net/user/giulianodeluc...
👆
🎬More Videos:
-Microsoft Teams: • Microsoft Teams
-Microsoft SharePoint: • Microsoft SharePoint
-Microsoft 365: • Microsoft 365
-Azure: • Microsoft Azure
-PowerPoint: • Microsoft PowerPoint
-⚙Tools: • ⚙Tools
-Shorts: • Playlist
📺My RUclips Channel:
/ giulianodeluca
🔗Let’s connect on social:
/ delucagiulian
/ delucagiuliano
/ delucagiulian
/ delucagiulian
/ delucagiulian
delucagiuliano.com
⏲Timestamps
00:00 Introduction
00:47 How to apply a custom site template in SharePoint
03:39 Using a free GitHub solution
04:52 How to create a new custom site template
06:19 How to trigger Power Automate / Logic App
10:30 Using PowerShell to create a new custom site template
14:08 Displaying the final result
16:28 Conclusion
#GiulianoDeLuca #DeLuca - Наука
What do you think about these tips?
Here's a playlist with all my Microsoft SharePoint videos
ruclips.net/p/PLRKPRVekwUn-3UEGYv99TbO6IBE0F1gL5
Awesome Giuliano!
Another great video .
This is an amazing overview of how to do this and the resources are so useful.
Thanks Martin for your kind words 🙏
Awesome, thanks for sharing 👍 ❤
Thanks for watching 😉 🙏
Finally someone who made a guide about this!
Just one question:
In the "Update Home Page" step in Power Automate, where does the code in the Body generates from?
Keep up the good work! :)
Thanks 🙏 Alexander
Very good video!
I just have a question.
How to create a custom template site, with a different design from the standard Communication Site and Team Site.
For example, how to best design a Communication (Custom Template) site that has a right side section, similar to the Human Resources template?
It's possible? Or every time we create a custom template with WebTemplate = "68", SharePoint, for example, generates a Communication Site with that huge Hero web part?
Great content
Thanks 😉
This video got me going in the right direction, however I’m struggling to figure out how to create a site template which sets up just the layout of the home page. I saw your site script does this and I’m wondering how you accomplished it or created the JSON for that layout. I saw at 1:25 you had a template which triggers a “record site creation event”. Does this accomplish this or does such a thing exist? Thanks for any additional help you can provide!
Hi Brandon, what really create the page with the layout and the structure is the Power Automate flow, you can import my sample that you can find here:
github.com/giuleon/CustomSiteTemplates
Hello Giuliano, Thanks for the video. It is really super. Is it possible to make header and footer in site templates?
Hi Kumar,
Thanks for watching, check out here what you can do
docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-json-schema
Great stuff. What was the fix you applied to the url? I can't get Add-SPOSiteScript to work. Error says triggeflow is invalid...url has invalid value. I noticed you truncated the url. How did you find the correct value?
Hi,
Thanks Patrick, please check if the verb is correct "triggerFlow" and you can copy the right URL going in the Logic App or Power Automate flow this one must be an http trigger, when you open it in the first block you can copy the URL and paste it in you PowerShell command Add-SPOSiteScript
Hi, Thanks for the video. It is really awesome and complete guide to create Site Template. I just have a question. Is that possible to create the Site template completely using JSON?
Hi,
Thanks for watching, yes you can define the template in your JSON
@@DeLucaGiulian That's great! I am trying to create a Custom site template using JSON alone. I have to add few web parts as a part of template like Quick link, Hero, People, Recent documents etc.. Do we have JSON for Web parts also. Could you please help me..
Great content. Can you please tell how you generate the canvascontent1? It would help many users
Thanks for watching and for your feedback, in order to read the field CanvasContent1 you can use in Power Automate the action "Send an HTTP request to SharePoint" add the site that you want to target and include in the URI something like this:
_api/sitepages/pages/GetByUrl('SitePages/Home.aspx')
The result will give you the content of the field CanvasContent1.
Normally I edit the page manually and when I'm ready, I run the flow in Power Automate to check the content of CanvasContent1.
@@DeLucaGiulian thanks for the information. It is very useful
@@DeLucaGiulian This is super helpful, thank you! I'm curious how you go about "escaping" the json in CanvasContent1 so that it has all of the \ characters.
Hello Giuliano. After seeing your video I am stuck on a question, and so I apologize about: If i have already a standard sharepoint site to be used as the default site template, how I can get/extract the script of customization, to upload to Org wide? Hope my question makes sense. Thank you and great video as always
Hi Sergio thank you for watching.
Once you created with PowerShell the site template then you can use a Logic App that runs when a user select the site template and create all pages needed
Unbelievably awful user experience from Microsoft...this should not be this hard.
Yah, for what should really be an out of the box feature - Microsoft have absolutely left SharePoint Administrators high and dry with Site Template and View Template creation.
I totally agree. I have been using the "save site as template" for years in older versions of SharePoint now that feature is basically gone. Totally ridiculous. Microsoft being Microsoft. I hate Microsoft. It makes me sad that I make my living using their software.
@@tomg4592I agree.
They keep pushing out new stuff without addressing the core issue.
And who else can get away with using paying customers for UAT?
😔
Hello, can you give me some advice on how to create flow and how can I create and add the site I want?
Hi, maybe this video can help you:
ruclips.net/video/kQqb_i-Vgew/видео.html
Hi Giuliano,
What if I want to create a List from a "Template from your oganization" option? How can I do that? How can I add the List template to be selected from that screen?
Hi,
Check this other video out
ruclips.net/video/N0d1DEIMYGM/видео.html
Hi. Is it possible to create a template from a communication site on one tenant and apply it as a communication / home site on another tenant?
For instance, I might want to create a set Home site on one tenant and replicate that on multiple tenants for multiple viva connection deployments?
Hi,
Yes this is possible and it's also the purpose of site templates
Who connection does the powerautomaet flow run under? Since "When a HTTP request is received" is a premium trigger, wouldnt everyone in the tenant need a premium license?
Hi Kevin,
As you mentioned the Http is a premium connector for this reason it would be better to use a Logic App and pay only for actual consumption
Hi Giuliano,
Thanks for an amazing video on custom site templates, I have a query here, how does the Power Automate Workflow know the Site URL (Web URL) of the site for which I am applying the template. I see from your Github code, you are just passing 2 parameters to the flow while invoking it (event, product), where do the rest of the inputs of that flow come from? (webUrl, webDescription, creatorName, Email, TimeUTC)? Could you please explain on a comment? Thanks in advance.
Hi,
Thanks for watching.
If you want to get the URL of the SharePoint site that is invoking your Logic App you need to use webUrl which comes directly from the SharePoint call along with webDescription, creatorName, Email, TimeUTC.
Hope this help.
Hi @@DeLucaGiulian, Thank you for your response. I have not used logic apps, I have configured the WF as when an HTTP request is received trigger as shown in your video. In that case, how do I pass the web URL and other details from the JSON script which triggers the flow?
Hi,
Parameters are sent automatically from SharePoint, you have to parse those properties mentioned, here the JSON schema:
{
"properties": {
"createdTimeUTC": {
"type": "string"
},
"creatorEmail": {
"type": "string"
},
"creatorName": {
"type": "string"
},
"parameters": {
"properties": {
"event": {
"type": "string"
},
"template": {
"type": "string"
}
},
"type": "object"
},
"webDescription": {
"type": "string"
},
"webUrl": {
"type": "string"
}
},
"type": "object"
}
Hi, does is possibile to automate the process to apply a custom template to a new site? I would like to automatically create a new sub site and auto apply the custom template. Thanks
Hi Pietro,
Thank you for your question, I suggest you to use a modern approach working with communication sites connected to an Hub Site.
Classic sun sites is the old way to have sites connected to the parent, in any case going to your question yes this approach works in your scenario.
I have created a department site and already associated it with the hub, do I need to disconnect them before following this video and do this process twice with each site separately to create two templates (one for departments and another for the home page).
Hi,
You can keep them as is and run the script twice.
Is it possible to make changes to the custom site in share point, that are then saved in the custom site? So then I can use the modified version as a custom template in the next project?
Hi,
Yes, you can make changes to your site and then extract what you can.
Finally build your custom site templates with all the changes that you made.
Hi! the solution worked, however, I can't do webpart optimizations (create a template with several webparts), like with Microsoft templates... is it possible?
Hi,
Yes this is possible, you can create your custom template with your web parts inside the page.
@@DeLucaGiulian Hello! In this case, do I create my entire website (with webparts) and use it as a template? Generating script? Do you have a video demonstrating how to do it? Thanks!
Any thoughts on how we can add things such as Quicklinks web part that we want on all sites?
Hi,
Thanks for watching.
First of all, you have to place all web parts that you want to provision on every site.
In the video I showed using Power Automate how to get a property named "CanvasContent1", this property contains everything you see on the page.
It's just a matter of creating new pages adding the property CanvasContent1.
@@DeLucaGiulian Thanks for the reply. Would it be possible to dynamically fill in data to web parts such as "People" and add the user who requested the new site? Or add group calendar and pair it with the newly created Team?
Yes this is feasible adding all this info in the Canvascontent1 property
@@DeLucaGiulian Got everything working perfectly. Question, I looked at the MS documentation, couldn't find a way to add a choice column though. Any thoughts? Perhaps I should do it using HTTP request in a different Action?
That's great!
Choice fields are not supported with site tamplates as you mentioned you should use the SharePoint rest api to achieve this goal.
There are many samples online, you can check this one:
www.alanps1.io/power-platform/flow/flow-create-sharepoint-list-choice-fields-using-rest-api-with-power-automate/
Could you please let me know if we can do this without powerautomate do we have any link for htat ?
Hi,
Yes you can avoid power automate if you want but it is more limited, check this link out
learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-overview
@@DeLucaGiulian Sure I have tried this already but it seems like only the color are getting copied not the whole template any idea ? :(
As I said without Power Automate is limited, these are the things that you can do:
Creating a new list or library (or modifying the default one created with the site)
Creating site columns, content types, and configuring other list settings
Set site branding properties like navigation layout, header layout and header background
Applying a theme**
Setting a site logo
Adding links to quick launch or hub navigation**
Triggering a Power Automate flow
Installing a deployed solution from the app catalog
Setting regional settings for the site**
Adding principals (users and groups) to SharePoint roles**
Setting external sharing capability for the site**
How do I remove the added template from my organization?
Hi,
Thanks for your question.
You must run the opposite PowerShell commands Remove-SPOSiteDesign, Remove-SPOSiteScript
learn.microsoft.com/en-us/powershell/module/sharepoint-online/remove-spositedesign?view=sharepoint-ps
There should really have been an option to create a site which contains most of the things a department might need and than MAKE TEMPLATE. 😁
answers to the following questions
1.)Can multiple document libraries be included in a site template
2.)Can multiple site pages be included in a site template
3.)Can custom folder structures in a documents library be incorporated into a site template
4.)Can custom permissions settings be incorporated as part of a site template
5.)Can custom site templates be applied to Team sites (SharePoint sites connected to Microsoft Teams)
Hi,
1- yes
2- yes
3-4- your custom site template can call your Power Automate flow that will run in order to add the folders that you want, you can use this approach to add pages, lists, doc libraries and even change permission
5- Yes this is also possible
This video is SO NOT helpful at all. All you did was show us a pre-made script and how to set it up and run it.
What if we want to create a template from scratch? Is there a web builder with a GUI, or do you code it all out manually? That's what I wanted to know.
Hi Freddie,
Thanks for watching there is no GUI that help you to build your custom template, however you can follow this documentation to understand how to build your JSON:
learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-overview
This link is also in the description of my video