Note*
In order to perform this step you need to be an administrator of your O365 Tenant.
Make sure that you have the latest version of the SharePoint Online Management Shell available on the Microsoft Download site.
Run the SharePoint Online Management Shell as Administrator (right-click on the icon).
Update the PowerShell Execution Policy on your system to allow the script to run by executing the following cmdlet:
Set-ExecutionPolicy RemoteSigned
Confirm that you are sure you want to perform this action by typing A and pressing Enter.
Connect to the SharePoint Online Administration Center by executing the following:
Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking
Connect-SPOService -Url https://tenant-admin.sharepoint.com -credential $credential
When the Sign in window pops up, use your admin credentials to log in:
e.g.Enable scripting capabilities on the site that you want to add modern page templates to by executing the following cmdlet:
Set-SPOsite https://tenant.sharepoint.com/sites/your-site -DenyAddAndCustomizePages 0
Next, you must make sure that users are allowed to run a custom script on personal sites and self-service created sites in your tenant.
From the app launcher menu (in the upper-left corner), select Admin to open the Office 365 admin center.
In the left pane, select Admin centers > SharePoint
Select settings in the left pane. Scroll down to the Custom Script section.
Make sure that Allow users to run custom script on personal sites and Allow users to run custom script on self-service created sites are selected. If not, select Allow users to run custom script for both entries.
Extract YourPackage.zip file.
Navigate to the top-level modern site of the site collection you want to add modern page templates to (this should be a Communication Site).
Open the settings menu by clicking the gears icon on the top navigation bar, and then select Site Information > View all site settings to go to the Site Settings page.
On the Site Settings page, select Solutions under Web Designer Galleries.
Important Note*
In the Solutions Gallery, select Upload Solution > navigate to the extracted YourPackage.zip > Modern_Templates > O365 folder, and upload the Tempate_Library.wsp file.
Activate the uploaded solution.
Staying on the same top-level site, go to the Site Contents page.
On the Site Contents page click New and select Subsite
On the New SharePoint Site page, for Title: enter Template Library, for URL name: enter Template-Library. Under the Template Selection section click Custom tab, and select MasterThemes Template Library.
Select No for Navigation inheritance and click Create. The template will create its own navigation structure to help you easily browse through page templates.
Important Note*
To see how the page templates look like with the SPFx Modern Theme Solution applied, click the gears icon on the top navigation bar of your newly created Template Library subsite, select Add an app to go to your Apps page, and install the MT-Modern-Theme-01 solution.
Note:
The Modern Page Templates delivered with this package (YourPackage.zip) are intended for use on Communication Sites.
There are multiple ways of copying or moving contents across SharePoint sites. In this step, you will find four methods of adding the Modern Page Templates to Modern Sites:
A - from a subsite created in step 2 using SharePoint Designer 2013 (recommended)
B - from a subsite created in step 2 using your browser
C - directly from the package (YourPackage.zip) using SharePoint Designer 2013
D - directly from the package (YourPackage.zip) using your browser
The easiest and recommended method of adding the Modern Page Templates to Modern Sites is to use SharePoint Designer 2013. This software supports SharePoint Online in addition to SharePoint On-Premises 2019, 2016, and 2013 versions. With SharePoint Designer 2013 you can quickly copy multiple page templates to any modern site.
Download SharePoint Designer 2013 from Microsoft Download Center, and install it on your device (it is a free software).
When the subsite (Template Library) is loaded, navigate to the Site Pages folder, select all (Clrl+A) ".aspx" pages stored in this folder, and copy them to your clipboard (Ctrl+C).
When the modern site is loaded, navigate to the Site Pages folder, click the empty space (in the right pane), and paste files from your clipboard (Ctrl+V) to it.
If you get the error message Server error: Access denied, perform step 1 in this document to be able to add pages to your site (Step 1: Enable scripting capabilities on your site - from 1 to 7).
Important Note*
After the page templates are placed in a new location, you can access them from your browser and start providing edits.
When the Site Pages list is loaded, click the gears icon on the top navigation bar, and then select Library settings to switch the display settings for this list from modern experience to classic. This procedure is necessary for getting access to the controls not available within the modern experience.
On the Settings page for Site Pages list, select Advanced settings.
When the Advanced settings dialog form is loaded, scroll down the page until you see the List experience section.
In the List experience section select Classic experience and click OK.
Return to the Site Pages list which now should be displayed in classic experience. If not, close your browser and reopen the list (it may take some time for the change to take effect).
If you get the error message Sorry, you don't have access, perform step 1 in this document (Step 1: Enable scripting capabilities on your site - from 1 to 7) to be able to add pages to your site.
Important Note*
To switch back the Site Pages library to modern experience, select Library Settings from the ribbon > Advanced settings > select New experience for the List Experience > click OK.
After the page templates are placed in a new location, you can access them from your browser and start providing edits.
Note:
All the ".aspx" source files for Modern Page Templates are enclosed in the Site_Pages folder of the Theme Package (the extracted YourPackage.zip file). You can use SharePoint Designer or your browser (from classic mode for Site Pages library) to add them directly to your modern sites, without creating a subsite as instructed in the previous Step: 2. Be advised that if you add them to the Site Pages library this way, a navigation structure that will help you preview the page templates will not be created.
In SharePoint Designer open the modern site to which you want to add the Modern Page Templates.
When the modern site is loaded, navigate to the Site Pages folder, click the empty space (in the right pane), and paste files from your clipboard (Ctrl+V) to it.
If you get the error message Sorry, you don't have access, perform step 1 in this document to be able to add pages to your site (Step 1: Enable scripting capabilities on your site - from 1 to 7).
Important Note*
After the page templates are placed in a new location, you can access them from your browser and start providing edits.
Note:
All the ".aspx" source files for Modern Page Templates are enclosed in the Site_Pages folder of the Theme Package (the extracted YourPackage.zip file). You can use SharePoint Designer or your browser (from classic mode for Site Pages library) to add them directly to your modern sites, without creating a subsite as instructed in the previous Step: 2. Be advised that if you add them to the Site Pages library this way, a navigation structure that will help you preview the page templates will not be created.
In SharePoint Designer open the modern site to which you want to add the Modern Page Templates.
In your browser, open the modern site to which you want to add the Modern Page Templates.
When the Site Pages list is loaded, click the gears icon on the top navigation bar, and then select Library settings to switch the display settings for this list from modern experience to classic. This procedure is necessary for getting access to the controls not available within the modern experience.
On the Settings page for Site Pages list, select Advanced settings.
When the Advanced settings dialog form is loaded, scroll down the page until you see the List experience section.
In the List experience section select Classic experience and click OK.
Return to the Site Pages list which now should be displayed in classic experience. If not, close your browser and reopen the list (it may take some time for the change to take effect).
Important Note*
To switch back the Site Pages library to modern experience, select Library Settings from the ribbon > Advanced settings > select New experience for the List Experience > click OK.