Skip to content

Commit 12152d9

Browse files
committed
doc updates for the upcoming June release
1 parent 23e9e90 commit 12152d9

File tree

2 files changed

+61
-21
lines changed

2 files changed

+61
-21
lines changed

docs/transform/modernize-userinterface-site-pages-model-publishing.md

Lines changed: 59 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -178,24 +178,6 @@ For each field that you want to take over you'll need to add a Field element spe
178178
> - Functions support is not available for taxonomy fields
179179
> - Page property web part configuration was introduced in the June 2019 release
180180
181-
#### Page preview image options
182-
183-
When a page has a page header image that image will also be used as a page preview image. If you however want to control the page preview image then you can populate the `BannerImageUrl` field using either the `ToPreviewImageUrl` function or by specifying a hard coded value as shown in below samples.
184-
185-
```XML
186-
<!-- When you do have a publishing image field that will need to be set as preview image -->
187-
<Field Name="PreviewImage" TargetFieldName="BannerImageUrl" Functions="ToPreviewImageUrl({PreviewImage})" />
188-
189-
<!-- When you do have a hard coded preview image already available on the target site. Note that the source field name (PublishingContactEmail in below sample) must exist, although it's not used here -->
190-
<Field Name="PublishingContactEmail" TargetFieldName="BannerImageUrl" Functions="StaticString('https://contoso.sharepoint.com/_layouts/15/getpreview.ashx?guidSite=88eebac1710b464cb6816639340fac55&amp;guidWeb=277fe40db9d24da5bbc6827714184958&amp;guidFile=91bf17fd54e849149a3ad6b4f006304e&amp;ext=jpg')" />
191-
192-
<!-- When you want to refer a static image living in the source site -->
193-
<Field Name="PreviewImage" TargetFieldName="BannerImageUrl" Functions="ToPreviewImageUrl('/sites/classicportal/images/myimage.jpg')" />
194-
```
195-
196-
> [!Note]
197-
> Controlling the page preview image was introduced with the May 2019 release.
198-
199181
### WebParts element
200182

201183
Each field in the classic publishing page that needs to become a visual element on the target page (like a web part or text) must defined in the web parts section:
@@ -303,4 +285,62 @@ Now that the assembly has been defined you can use your functions and selectors
303285

304286
```Xml
305287
<Property Name="ListId" Type="guid" Functions="{ListServerRelativeUrl} = Custom.MyListAddServerRelativeUrl({ListId})"/>
306-
```
288+
```
289+
290+
## Page layout mapping FAQ
291+
292+
### I want to keep the source page creation and modification information
293+
294+
You can do this by altering your page layout mapping like shown in below sample:
295+
296+
```XML
297+
<MetaData>
298+
...
299+
<Field Name="Created" TargetFieldName="Created" Functions="" />
300+
<Field Name="Modified" TargetFieldName="Modified" Functions="" />
301+
<Field Name="Author" TargetFieldName="Author" Functions="" />
302+
<Field Name="Editor" TargetFieldName="Editor" Functions="" />
303+
...
304+
</MetaData>
305+
```
306+
307+
If you however publish this page the modification data will change again. If you want to keep the modification date and publish you can add these 2 additional fields:
308+
309+
```XML
310+
<MetaData>
311+
...
312+
<Field Name="PublishingStartDate" TargetFieldName="FirstPublishedDate" Functions="" />
313+
<Field Name="ID" TargetFieldName="PromotedState" Functions="StaticString('2')" />
314+
...
315+
</MetaData>
316+
```
317+
318+
### I want to promote the created pages as news
319+
320+
Promoting pages created from a page layout as news pages can be be done by adding the below fields to your page layout mapping:
321+
322+
```XML
323+
<MetaData>
324+
...
325+
<Field Name="ID" TargetFieldName="PromotedState" Functions="StaticString('2')" />
326+
...
327+
</MetaData>
328+
```
329+
330+
### Can I control the page preview image
331+
332+
When a page has a page header image that image will also be used as a page preview image. If you however want to control the page preview image then you can populate the `BannerImageUrl` field using either the `ToPreviewImageUrl` function or by specifying a hard coded value as shown in below samples.
333+
334+
```XML
335+
<!-- When you do have a publishing image field that will need to be set as preview image -->
336+
<Field Name="PreviewImage" TargetFieldName="BannerImageUrl" Functions="ToPreviewImageUrl({PreviewImage})" />
337+
338+
<!-- When you do have a hard coded preview image already available on the target site. Note that the source field name (PublishingContactEmail in below sample) must exist, although it's not used here -->
339+
<Field Name="PublishingContactEmail" TargetFieldName="BannerImageUrl" Functions="StaticString('https://contoso.sharepoint.com/_layouts/15/getpreview.ashx?guidSite=88eebac1710b464cb6816639340fac55&amp;guidWeb=277fe40db9d24da5bbc6827714184958&amp;guidFile=91bf17fd54e849149a3ad6b4f006304e&amp;ext=jpg')" />
340+
341+
<!-- When you want to refer a static image living in the source site -->
342+
<Field Name="PreviewImage" TargetFieldName="BannerImageUrl" Functions="ToPreviewImageUrl('/sites/classicportal/images/myimage.jpg')" />
343+
```
344+
345+
> [!Note]
346+
> Controlling the page preview image was introduced with the May 2019 release.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ SkipUrlRewriting (as of May 2019 release, version 3.9.1905.*) | | Publishing pa
5757

5858
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:
5959

60-
```
60+
```Powershell
6161
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/portaltomodernize
6262
6363
ConvertTo-PnPClientSidePage -PublishingPage -Identity mypage.aspx -Overwrite -TargetWebUrl https://contoso.sharepoint.com/sites/moderncommunicationsite
@@ -90,7 +90,7 @@ Open the [created mapping file](modernize-userinterface-site-pages-model-publish
9090

9191
Using the cleaned custom mapping file is simple via the `PageLayoutMapping` parameter:
9292

93-
```
93+
```Powershell
9494
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/portaltomodernize
9595
9696
ConvertTo-PnPClientSidePage -PublishingPage -Identity mypage.aspx -Overwrite -TargetWebUrl https://contoso.sharepoint.com/sites/moderncommunicationsite -PageLayoutMapping c:\temp\mypagelayouts.xml

0 commit comments

Comments
 (0)