Skip to content

Commit b8bfc50

Browse files
committed
updates
1 parent 2c8f1a3 commit b8bfc50

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

docs/transform/modernize-userinterface-site-pages-powershell.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,53 @@ LogSkipFlush (as of April 2019 release, version 3.8.1904.*) | $false | All page
4242
DontPublish (as of April 2019 release, version 3.8.1904.*) | $false | All page types | Use the `-DontPublish` option to not publish the created modern page.
4343
DisablePageComments (as of April 2019 release, version 3.8.1904.*) | $false | All page types | Use `-DisablePageComments` if you want to disable the commenting option on the created page
4444
PublishingPage (as of April 2019 release, version 3.8.1904.*) | $false | Publishing pages | Set the `-PublishingPage` parameter if you're transforming a publishing page. For wiki and web part pages this parameter must be omitted or set to false.
45-
PageLayoutMapping as of April 2019 release, version 3.8.1904.*) | | Publishing pages |Via `-PageLayoutMapping` you can specify the path the page layout mapping file that you'll use for your publishing page transformations when the publishing page is using a non out of the box page layout
45+
PageLayoutMapping as of April 2019 release, version 3.8.1904.*) | | Publishing pages |Via `-PageLayoutMapping` you can specify the path the [page layout mapping file](modernize-userinterface-site-pages-model-publishing.md) that you'll use for your publishing page transformations when the publishing page is using a non out of the box page layout
4646

4747
(`*`) Mandatory command line parameter / (`**`) Mandatory when the `-PublishingPage` parameter was set
4848

4949
## FAQ
5050

51+
### How do I transform publishing pages
52+
53+
Above shown sample shows in-place page transformation, for transforming publishing pages you need a slightly different syntax. Below sample shows how to modernize the mypage.aspx page and create a modern version of it in a communication site. During this transformation the page transformation will either use the built-in page layout mapping if the page is using an out of the box page layout or it will generate a page layout mapping on the fly for custom page layouts:
54+
55+
```
56+
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/portaltomodernize
57+
58+
ConvertTo-PnPClientSidePage -PublishingPage -Identity mypage.aspx -Overwrite -TargetWebUrl https://contoso.sharepoint.com/sites/moderncommunicationsite
59+
```
60+
61+
If you're using custom page layouts it's highly recommended to tweak the used page layout mapping file before using it. To do so follow these steps:
62+
63+
#### Generate a custom page layout mapping file
64+
65+
Use PnP PowerShell to analyze your existing page layouts and generate a mapping file:
66+
67+
```
68+
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/portaltomodernize
69+
70+
Export-PnPClientSidePageMapping -CustomPageLayoutMapping -Folder c:\temp
71+
```
72+
73+
#### Clean the generated mapping file
74+
75+
Open the [created mapping file](modernize-userinterface-site-pages-model-publishing.md) and delete all the OOB page layouts (unless you've customized them) so you end up with a file containing only your custom page layout mappings. Then review each mapping:
76+
77+
- Set the row and column values correctly for web parts, web part zones and fixed web parts so that content shows up on the right spot on the modern page. You can have as many rows as you want, each row will be a section on the modern page. Column values are restricted to 1, 2 or 3 which translates to the possible column options in a modern page
78+
- Define the fields that need to be transformed as metadata
79+
- Review the generated mapping of fields to web parts
80+
- Review the generated mapping of fields to header
81+
82+
#### Use the custom mapping file
83+
84+
Using the cleaned custom mapping file is simple via the `PageLayoutMapping` parameter:
85+
86+
```
87+
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/portaltomodernize
88+
89+
ConvertTo-PnPClientSidePage -PublishingPage -Identity mypage.aspx -Overwrite -TargetWebUrl https://contoso.sharepoint.com/sites/moderncommunicationsite -PageLayoutMapping c:\temp\mypagelayouts.xml
90+
```
91+
5192
### I used the "AddPageAcceptBanner" switch but don't see the banner web part on the created pages
5293

5394
In order to make the banner webpart work there are 2 requirements that have to be met:

0 commit comments

Comments
 (0)