How to Change the Page Layout of a Modern SharePoint Online Page?
Requirement: Change the page layout in modern SharePoint Online sites.
How to change the page layout in SharePoint Online?
In SharePoint Online, a page layout is a predefined design for a page that determines the overall look and feel of the page, including the layout of the content, the location of web parts and other page elements, and the styles and formatting applied to the page. Page layouts are used to create a consistent look and feel for the pages in a SharePoint site, and can be customized by site administrators to meet the specific needs of the site.
By default, SharePoint Online includes a number of predefined page layouts that are available for use, depending on the site template that was used to create the site. Site administrators can also create custom page layouts if the default layouts do not meet the needs of the site.
The modern SharePoint Online supports 3-page layouts in total:
- Home Page Layout – Used by the landing page, comes with no banner on the top.
- Article Page Layout – Default page layout for modern pages comes with a top banner.
- Single Part App Page Layout – To host a single web part
If you want to change the page layout, there are no UI ways to do it today! However, PowerShell can help:
PnP PowerShell to Change the Page Layout in SharePoint Online:
We wanted a top banner to appear on the Home page! So, here is the PowerShell to set the page layout for a modern SharePoint Online page.
#Parameters $SiteURL = "https://crescent.sharepoint.com/sites/knowledgehub" $PageName = "Home.aspx" $PageLayout = "Article" #Home, Article, SingleWebPartApp #Connect to PnP Online Connect-PnPOnline -Url $SiteURL -Interactive #Set the Page Layout Set-PnPPage -Identity $PageName -LayoutType $PageLayout
If you are using the Legacy PnP PowerShell module, use “Set-PnPClientSidePage” instead of the Set-PnPPage cmdlet in the above script. My home page layout changed to an Article page with a banner:
Here is a related post to change the page layout from Home to Article: How to Remove the Top Banner from SharePoint Online Modern Pages?
One thought on “How to Change the Page Layout of a Modern SharePoint Online Page?”
I can not seem to get this to work for me, as the Connect-PnPOnline seems to not be recognized as a cmdlet.