{"id":2648,"date":"2019-03-13T15:06:04","date_gmt":"2019-03-13T23:06:04","guid":{"rendered":"https:\/\/developer.microsoft.com\/en-us\/office\/blogs\/?p=2648"},"modified":"2019-03-13T15:06:04","modified_gmt":"2019-03-13T23:06:04","slug":"modernize-your-sharepoint-pages-march-update","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/modernize-your-sharepoint-pages-march-update\/","title":{"rendered":"Modernize your SharePoint pages: March update"},"content":{"rendered":"<h2>Modernization overview<\/h2>\n<p>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 <a href=\"https:\/\/support.office.com\/en-us\/article\/sharepoint-classic-and-modern-experiences-5725c103-505d-4a6e-9350-300d3ec7d73f?ui=en-US&amp;rs=en-US&amp;ad=US\">SharePoint classic and modern experiences<\/a> article and get inspired by the <a href=\"https:\/\/sharepointlookbook.azurewebsites.net\/\">SharePoint Look Book<\/a>.<\/p>\n<p>All of this is great, but you might ask yourself, <strong>I have lots of classic (team) sites&#8230;how do I bring them into the modern SharePoint world?<\/strong> The answer is (in-place) modernization: you can fully transform (or &#8220;modernize&#8221;) a classic site team sites into modern, optionally Office 365 group-connected, sites by following the SharePoint <a href=\"https:\/\/aka.ms\/sppnp-modernize\">modernization guidance<\/a>. Check out the <a href=\"https:\/\/developer.microsoft.com\/en-us\/office\/blogs\/modernize-your-sharepoint-pages\/\">Modernize your SharePoint pages <\/a>blog post to learn more about the page modernization basics.<\/p>\n<p>A key part of modernizing your sites is transforming your\u00a0wiki and web part pages into modern client-side pages. This transformation is possible using the <a href=\"https:\/\/www.nuget.org\/packages\/SharePointPnPModernizationOnline\">SharePoint PnP Modernization framework<\/a>, which is\u00a0a .Net library that you can use via either .<a href=\"https:\/\/docs.microsoft.com\/en-us\/sharepoint\/dev\/transform\/modernize-userinterface-site-pages-dotnet\">Net code<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/sharepoint\/dev\/transform\/modernize-userinterface-site-pages-powershell\">PnP PowerShell<\/a> or the <a href=\"https:\/\/aka.ms\/sppnp-pagetransformationui\">Page Transformation UI tool<\/a>.<\/p>\n<h2>March 2019 updates<\/h2>\n<p>The March release of the SharePoint PnP Modernization framework contains several major improvements. The March release is available via:<\/p>\n<ul>\n<li><a href=\"https:\/\/aka.ms\/sppnp-powershell\">PnP PowerShell<\/a> version 3.7.1903.0 or higher<\/li>\n<li>The <a href=\"https:\/\/www.nuget.org\/packages\/SharePointPnPModernizationOnline\">SharePoint PnP Modernization framework<\/a> version 1.0.1903.0 or higher<\/li>\n<\/ul>\n<h3>Cross-site page transformation<\/h3>\n<p>The default page transformation behavior is to create the modern\u00a0client-side pages in the same site as the source wiki or web part page, but now you can also create the modern client-side page in another, modern, site collection (e.g. a communication site). During a cross-site page transformation, dependent media assets (images, videos) are copied from the source site collection to the sitepages library in the target site collection.<\/p>\n<h5>Using PnP PowerShell<\/h5>\n<p>When using <a href=\"https:\/\/aka.ms\/sppnp-powershell\">PnP PowerShell<\/a> you can specify the url of the target site collection via the <strong>TargetWebUrl<\/strong> parameter.<\/p>\n<pre># Connect to the site with pages to modernize \nConnect-PnPOnline -Url https:\/\/contoso.sharepoint.com\/sites\/ateamsite \n# Modernize page1.aspx and create the resulting modern client side page in another site \nConvertTo-PnPClientSidePage -Identity page1.aspx <strong>-TargetWebUrl<\/strong> https:\/\/contoso.sharepoint.com\/sites\/acommunicationsite<\/pre>\n<h5>Using .Net<\/h5>\n<p>When <a href=\"https:\/\/docs.microsoft.com\/en-us\/sharepoint\/dev\/transform\/modernize-userinterface-site-pages-dotnet\">using .Net<\/a> you need to create a ClientContext object instance for the target web and specify that in the PageTransformator constructor as shown in below code snippet.<\/p>\n<pre>var pageTransformator = new PageTransformator(sourceClientContext, <strong>targetClientContext<\/strong>); \nvar pages = clientContext.Web.GetPages(); \nforeach (var page in pages) \n{ \u00a0\u00a0\u00a0 \n  PageTransformationInformation pt = new PageTransformationInformation(page) \u00a0\u00a0\u00a0 \n  { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \n    \/\/ If target page exists, then overwrite it \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \n    Overwrite = true, \u00a0\u00a0\u00a0 \n  }; \u00a0\u00a0\u00a0 \n  pageTransformator.Transform(pt); \n}<\/pre>\n<h5>Note:<\/h5>\n<p>Not all web parts are supported for a cross-site transfer. More web parts will be enabled in upcoming releases, check out the\u00a0<strong>Cross-site support<\/strong>\u00a0column in\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/sharepoint\/dev\/transform\/modernize-userinterface-site-pages-webparts\">web part transformation list<\/a>\u00a0to learn more.<\/p>\n<h3>New and improved web part transformations<\/h3>\n<p>The following web parts are now transformed as well. Check out the\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/sharepoint\/dev\/transform\/modernize-userinterface-site-pages-webparts\">web part transformation list<\/a>\u00a0to get an overview of which web parts are transformed and how.<\/p>\n<ul>\n<li>NEW: <strong>ContentBySearchWebPart<\/strong> and <strong>ResultScriptWebPart<\/strong> are transformed to the Highlighted Content web part<\/li>\n<li>NEW: <strong>ContactFieldControl<\/strong> is transformed into the People web part<\/li>\n<li>UPDATE: <strong>SummaryLinks<\/strong> now by default goes to the QuickLinks web part, optionally transformation to HTML is still possible<\/li>\n<li>UPDATE: <strong>ContentByQueryWebPart<\/strong>\u00a0better supports site and site collection scoped queries<\/li>\n<li>UPDATE: The toolbar visibility setting from an <strong>XSLTListViewWebPart<\/strong> is now taken over to the respective modern List and Library web parts<\/li>\n<li>UPDATE: <strong>ContentEditorWebPart<\/strong> now reads content from linked files (e.g. html) file and transforms these as HTML on the page<\/li>\n<\/ul>\n<h3>Other improvements<\/h3>\n<div>Other key improvements are:<\/div>\n<ul>\n<li>Empty text parts (so parts having HTML without visual content) are now dropped<\/li>\n<li>The new configuration option <strong>RemoveEmptySectionsAndColumns<\/strong> is on by default and will remove all empty sections and columns from a transformed page. This will result in cleaner pages that better use the available screen estate<\/li>\n<li>No need anymore to update the mapping file if you want to use the community script editor web part in your transformation: the mapping file behavior can be configured using mapping properties. For <a href=\"https:\/\/aka.ms\/sppnp-powershell\">PnP PowerShell<\/a> usage you specify the\u00a0<strong>UseCommunityScriptEditor<\/strong> switch, for .Net set a mapping property on the PageTransformationInformation instance (<strong>MappingProperties[<span class=\"hljs-string\">&#8220;UseCommunityScriptEditor&#8221;<\/span>] = <span class=\"hljs-string\">&#8220;true&#8221;<\/span>;<\/strong>)<\/li>\n<\/ul>\n<div>\n<h2>Resources<\/h2>\n<ul>\n<li><a href=\"https:\/\/aka.ms\/sppnp-modernize\">Modernization landing page<\/a><\/li>\n<li><a href=\"https:\/\/aka.ms\/sppnp-pagetransformation\">Page transformation landing page<\/a><\/li>\n<\/ul>\n<p><span style=\"font-size: large\"><em>\u201cSharing is caring\u201d<\/em><\/span><\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p><i>SharePoint Team, Microsoft\u00a0 &#8211; 13th of March 2019<\/i><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>An overview of what&#8217;s new in the March release for SharePoint PnP Page Transformation.<\/p>\n","protected":false},"author":69078,"featured_media":2304,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2648","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-365-developer"],"acf":[],"blog_post_summary":"<p>An overview of what&#8217;s new in the March release for SharePoint PnP Page Transformation.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/2648","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/users\/69078"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=2648"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/2648\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/2304"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=2648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=2648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=2648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}