Modernize your SharePoint pages

SharePoint team

Modernization overview

SharePoint Online is continuously evolving and improving, which is a great thing for you as a consumer of the service. One of the key features is the availability of modern sites, which are modern Office 365 group-connected team sites or communication sites, combined with improved functionality that can be consumed from a beautiful, responsive, modern user interface. To learn more about modern checkout the SharePoint classic and modern experiences article and get inspired by the SharePoint Look Book.

All of this is great, but you might ask yourself, I have lots of classic (team) sites…how do I bring them into the modern SharePoint world? The answer is (in-place) modernization: you can fully transform (or “modernize”) a classic site team sites into modern, optionally Office 365 group-connected, sites by following the SharePoint modernization guidance. Modernizing your sites involves one or more of the below steps:

Modernization overview

Page modernization

Classic SharePoint sites typically have classic pages being wiki pages or web part pages and these pages cannot present themselves using a modern user interface, however, a classic site can host modern client-side pages. After you’ve maximized the use of the modern list and library user interface and optionally connected your site to an Office 365 Group, transforming the pages to modern client-side pages is the last task to fully transform your classic site into a modern site.

What does page modernization do?

Page modernization is done by transforming your classic wiki and web part pages into modern client-side pages. During the transformation the page structure (e.g. header with 2 columns) is kept, the wiki HTML is transformed into HTML that works on modern pages and the web parts on the pages are replaced by modern 1st party web parts. During this process the modern page is generated as a preview, the original page is never lost. You can, optionally, also have your end users decide on whether they want to keep the created page via an interactive banner:

Page transformation accept banner

How to use it?

Page transformation can be used via PnP PowerShell, via the SharePoint UI and via .Net.

Modernizing pages via PnP PowerShell

As of the December 2018 version (3.4.1812.0) of PnP PowerShell transforming a classic wiki or web part page into a modern client-side page is as simple as calling the ConvertTo-PnPClientSidePage cmdlet:

# Connect to the site with pages to modernize
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/ateamsite
# Modernize page1.aspx and add the page keep/discard banner on the page
ConvertTo-PnPClientSidePage -Identity page1.aspx -AddPageAcceptBanner

Learn more from here.

Modernizing pages via the SharePoint User Interface

If you want to give your end users the option to self-service modernize pages then using the SharePoint Page Transformation UI makes a lot of sense as it offers your end users UI extensions (ribbon buttons) to launch page transformation:

Page transformation UI banner button

Learn more from here.

Modernizing pages via .Net

To modernize pages using .Net you start with installing the SharePointPnPModernizationOnline NuGet package. Once that’s installed page transformation is as simple as below snippet:

var pageTransformator = new PageTransformator(clientContext);
var pages = clientContext.Web.GetPages();
foreach (var page in pages)
{
    PageTransformationInformation pt = new PageTransformationInformation(page)
    {
        // If target page exists, then overwrite it
        Overwrite = true,
    };
    pageTransformator.Transform(pt);
}

Learn more from here.

Resources

“Sharing is caring”

 


SharePoint Team, Microsoft – 10th of December 2018

Discussion is closed.

Feedback usabilla icon