Skip to content

Commit cf5b892

Browse files
committed
Updates for April release
1 parent 710b600 commit cf5b892

8 files changed

+267
-34
lines changed

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

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Page Transformation Functions and Selectors
33
description: Page Transformation Functions and Selectors
4-
ms.date: 03/06/2019
4+
ms.date: 04/04/2019
55
ms.prod: sharepoint
66
localization_priority: Normal
77
---
@@ -334,6 +334,20 @@ Name|Description
334334
Name|Description
335335
:-----|:----------
336336
{FileContents}|Text content of the file. Return empty string if file was not found
337+
### UserDocumentsToHighlightedContentProperties
338+
339+
**Description:** Maps the user documents web part data into a properties collection and supporting serverProcessedContent nodes for the content rollup (= Highlighted Content) web part
340+
341+
**Example:** `SiteDocumentsToHighlightedContentProperties()`
342+
343+
#### Output parameters
344+
345+
Name|Description
346+
:-----|:----------
347+
{JsonProperties}|Properties collection for the contentrollup (= Highlighted Content) web part
348+
{SearchablePlainTexts}|SearchablePlainTexts nodes to be added in the serverProcessedContent node
349+
{Links}|Links nodes to be added in the serverProcessedContent node
350+
{ImageSources}|ImageSources nodes to be added in the serverProcessedContent node
337351
### ContentBySearchToHighlightedContentProperties
338352

339353
**Description:** Maps content by search web part data into a properties collection and supporting serverProcessedContent nodes for the content rollup (= Highlighted Content) web part
@@ -454,6 +468,49 @@ Name|Description
454468
{PersonDepartment}|User's department
455469
{PersonPhone}|Phone number of the user
456470
{PersonSip}|SIP address of the user
471+
### EmptyString
472+
473+
**Description:** Returns an empty string
474+
475+
**Example:** `EmptyString()`
476+
477+
#### Output parameters
478+
479+
Name|Description
480+
:-----|:----------
481+
{return value}|Empty string
482+
### ToImageUrl
483+
484+
**Description:** Returns the server relative image url of a Publishing Image field value.
485+
486+
**Example:** `ToImageUrl({PublishingPageImage})`
487+
488+
#### Input parameters
489+
490+
Name|Description
491+
:-----|:----------
492+
{PublishingPageImage}|Publishing Image field value
493+
#### Output parameters
494+
495+
Name|Description
496+
:-----|:----------
497+
{return value}|Server relative image url
498+
### ToImageAltText
499+
500+
**Description:** Returns the image alternate text of a Publishing Image field value.
501+
502+
**Example:** `ToImageAltText({PublishingPageImage})`
503+
504+
#### Input parameters
505+
506+
Name|Description
507+
:-----|:----------
508+
{PublishingPageImage}|Publishing Image field value
509+
#### Output parameters
510+
511+
Name|Description
512+
:-----|:----------
513+
{return value}|Image alternate text
457514
## Selectors
458515
### TextSelector
459516

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

Lines changed: 121 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Options to control the page transformation process
33
description: Explains how to configure the page transformation process
4-
ms.date: 03/06/2019
4+
ms.date: 04/04/2019
55
ms.prod: sharepoint
66
localization_priority: Normal
77
---
88

99
# Page transformation configuration options
1010

11-
When you use the page transformation framework you do have a lot of control on how the page transformation is done. The model to control this is by specifying the correct configuration as part of the `PageTransformationInformation` instance that you use to launch page transformation. In this article you'll learn more about the available options.
11+
When you use the page transformation framework you do have a lot of control on how the page transformation is done. The model to control this is by specifying the correct configuration as part of the `PageTransformationInformation` instance for wiki and web part pages or a `PublishingPageTransformationInformation` instance for publishing pages. The created transformation instance is what you use to launch page transformation. In this article you'll learn more about the available options.
1212

1313
> [!IMPORTANT]
1414
> The SharePoint PnP Modernization framework is continuously evolving, checkout [the release notes](https://github.com/SharePoint/sp-dev-modernization/tree/master/Tools/SharePoint.Modernization/Modernization%20Framework%20release%20notes.md) to stay up to date on the latest changes. If you encounter problems please file an issue in the [sp-dev-modernization GitHub issue list](https://github.com/SharePoint/sp-dev-modernization/issues).
@@ -28,6 +28,13 @@ PageTransformationInformation pti = new PageTransformationInformation(page)
2828
};
2929
```
3030

31+
```Csharp
32+
PublishingPageTransformationInformation pti = new PublishingPageTransformationInformation(page)
33+
{
34+
Overwrite = true,
35+
};
36+
```
37+
3138
## AddPageAcceptBanner option
3239

3340
Type | Default value if not specified
@@ -47,6 +54,9 @@ PageTransformationInformation pti = new PageTransformationInformation(page)
4754
};
4855
```
4956

57+
> [!NOTE]
58+
> This option is not available for publishing page transformation.
59+
5060
## TargetPagePrefix option
5161

5262
Type | Default value if not specified
@@ -62,6 +72,9 @@ PageTransformationInformation pti = new PageTransformationInformation(page)
6272
};
6373
```
6474

75+
> [!NOTE]
76+
> This option is not available for publishing page transformation.
77+
6578
## TargetPageTakesSourcePageName option
6679

6780
Type | Default value if not specified
@@ -80,6 +93,10 @@ PageTransformationInformation pti = new PageTransformationInformation(page)
8093
> [!IMPORTANT]
8194
> During the rename of the original page to a page starting with the Previous_ prefix the version history of the original page is not retained.
8295
96+
97+
> [!NOTE]
98+
> This option is not available for publishing page transformation.
99+
83100
## SourcePagePrefix option
84101

85102
Type | Default value if not specified
@@ -95,6 +112,9 @@ PageTransformationInformation pti = new PageTransformationInformation(page)
95112
};
96113
```
97114

115+
> [!NOTE]
116+
> This option is not available for publishing page transformation.
117+
98118
## ReplaceHomePageWithDefaultHomePage option
99119

100120
Type | Default value if not specified
@@ -110,6 +130,9 @@ PageTransformationInformation pti = new PageTransformationInformation(page)
110130
};
111131
```
112132

133+
> [!NOTE]
134+
> This option is not available for publishing page transformation.
135+
113136
## KeepPageSpecificPermissions option
114137

115138
Type | Default value if not specified
@@ -125,6 +148,13 @@ PageTransformationInformation pti = new PageTransformationInformation(page)
125148
};
126149
```
127150

151+
```Csharp
152+
PublishingPageTransformationInformation pti = new PublishingPageTransformationInformation(page)
153+
{
154+
KeepPageSpecificPermissions = false,
155+
};
156+
```
157+
128158
## CopyPageMetadata option (as of February 2019 release)
129159

130160
Type | Default value if not specified
@@ -140,6 +170,9 @@ PageTransformationInformation pti = new PageTransformationInformation(page)
140170
};
141171
```
142172

173+
> [!NOTE]
174+
> This option is not available for publishing page transformation. Use the publishing page layout mapping model to define if metadata needs to be copied and how that needs to happen.
175+
143176
## RemoveEmptySectionsAndColumns option (as of March 2019 release)
144177

145178
Type | Default value if not specified
@@ -155,6 +188,13 @@ PageTransformationInformation pti = new PageTransformationInformation(page)
155188
};
156189
```
157190

191+
```Csharp
192+
PublishingPageTransformationInformation pti = new PublishingPageTransformationInformation(page)
193+
{
194+
RemoveEmptySectionsAndColumns = false,
195+
};
196+
```
197+
158198
## MappingProperties dictionary (as of March 2019 release)
159199

160200
Type | Default value if not specified
@@ -175,6 +215,62 @@ pti.MappingProperties["SummaryLinksToQuickLinks"] = "false";
175215
pageTransformator.Transform(pti);
176216
```
177217

218+
```csharp
219+
PublishingPageTransformationInformation pti = new PublishingPageTransformationInformation(page)
220+
{
221+
// If target page exists, then overwrite it
222+
Overwrite = true,
223+
};
224+
225+
pti.MappingProperties["SummaryLinksToQuickLinks"] = "false";
226+
227+
pageTransformator.Transform(pti);
228+
```
229+
230+
## PublishCreatedPage option (as of April 2019 release)
231+
232+
Type | Default value if not specified
233+
-----|----
234+
Bool | true
235+
236+
The default behavior is to publish the created modern page, use this option if you want to prevent that.
237+
238+
```Csharp
239+
PageTransformationInformation pti = new PageTransformationInformation(page)
240+
{
241+
PublishCreatedPage = false,
242+
};
243+
```
244+
245+
```Csharp
246+
PublishingPageTransformationInformation pti = new PublishingPageTransformationInformation(page)
247+
{
248+
PublishCreatedPage = false,
249+
};
250+
```
251+
252+
## DisablePageComments option (as of April 2019 release)
253+
254+
Type | Default value if not specified
255+
-----|----
256+
Bool | false
257+
258+
The default behavior is to leave page comments enabled, use this option if you want to create a page with disabled page comments
259+
260+
```Csharp
261+
PageTransformationInformation pti = new PageTransformationInformation(page)
262+
{
263+
DisablePageComments = true,
264+
};
265+
```
266+
267+
```Csharp
268+
PublishingPageTransformationInformation pti = new PublishingPageTransformationInformation(page)
269+
{
270+
DisablePageComments = true,
271+
};
272+
```
273+
178274
## HandleWikiImagesAndVideos option
179275

180276
Type | Default value if not specified
@@ -190,6 +286,13 @@ PageTransformationInformation pti = new PageTransformationInformation(page)
190286
};
191287
```
192288

289+
```Csharp
290+
PublishingPageTransformationInformation pti = new PublishingPageTransformationInformation(page)
291+
{
292+
HandleWikiImagesAndVideos = false,
293+
};
294+
```
295+
193296
## PageHeader option
194297

195298
Type | Default value if not specified
@@ -205,6 +308,9 @@ PageTransformationInformation pti = new PageTransformationInformation(page)
205308
};
206309
```
207310

311+
> [!NOTE]
312+
> This option is not available for publishing page transformation. Use the page layout mapping model to determine how the page header must be constructed.
313+
208314
## PageTitleOverride option
209315

210316
Type | Default value if not specified
@@ -226,6 +332,19 @@ PageTransformationInformation pti = new PageTransformationInformation(page)
226332
};
227333
```
228334

335+
```Csharp
336+
// Local functions
337+
string titleOverride(string title)
338+
{
339+
return $"{title}_1";
340+
}
341+
342+
PublishingPageTransformationInformation pti = new PublishingPageTransformationInformation(page)
343+
{
344+
PageTitleOverride = titleOverride,
345+
};
346+
```
347+
229348
## LayoutTransformatorOverride option
230349

231350
Type | Default value if not specified

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

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Transform classic pages to modern client-side pages using .Net
33
description: Explains how to transform classic wiki and web part pages into modern client side pages using the SharePoint .Net
4-
ms.date: 03/06/2019
4+
ms.date: 04/04/2019
55
ms.prod: sharepoint
66
localization_priority: Normal
77
---
@@ -113,6 +113,46 @@ using (var cc = am.GetSharePointOnlineAuthenticatedContextTenant(siteUrl, userNa
113113
> [!Note]
114114
> Not all web parts lend themselves well for a cross site transfer, check the **Cross site support** column in [web part transformation list](modernize-userinterface-site-pages-webparts.md) to learn more.
115115
116+
### I want to transform publishing pages (as of April 2019 release, version 1.0.1904.*)
117+
118+
Publishing page transformation always will be a cross site transformation as mixing modern client side pages with publishing pages is unsupported. Below sample shows how all publishing pages starting with an "a" are transformed to client side pages in the https://contoso.sharepoint.com/sites/mycommunicationsite site. This sample also shows how to provide a custom page layout mapping file.
119+
120+
```csharp
121+
string siteUrl = "https://contoso.sharepoint.com/sites/mytestportal";
122+
string targetSiteUrl = "https://contoso.sharepoint.com/sites/mycommunicationsite";
123+
string userName = "[email protected]";
124+
AuthenticationManager am = new AuthenticationManager();
125+
using (var cc = am.GetSharePointOnlineAuthenticatedContextTenant(siteUrl, userName, GetSecureString("Password")))
126+
{
127+
using (var ccTarget = cc.Clone(targetSiteUrl))
128+
{
129+
var pageTransformator = new PublishingPageTransformator(cc, ccTarget, "C:\\temp\\custompagelayoutmapping.xml");
130+
var pages = cc.Web.GetPagesFromList("Pages");
131+
foreach (var page in pages)
132+
{
133+
PublishingPageTransformationInformation pti = new PublishingPageTransformationInformation(page, "a")
134+
{
135+
// If target page exists, then overwrite it
136+
Overwrite = true,
137+
};
138+
139+
try
140+
{
141+
Console.WriteLine($"Transforming publishing page {page.FieldValues["FileLeafRef"]}");
142+
pageTransformator.Transform(pti);
143+
}
144+
catch(ArgumentException ex)
145+
{
146+
Console.WriteLine($"Page {page.FieldValues["FileLeafRef"]} could not be transformed: {ex.Message}");
147+
}
148+
}
149+
}
150+
}
151+
```
152+
153+
> [!Note]
154+
> Not all web parts lend themselves well for a cross site transfer, check the **Cross site support** column in [web part transformation list](modernize-userinterface-site-pages-webparts.md) to learn more.
155+
116156
### I choose the "AddPageAcceptBanner" option but don't see the banner web part on the created pages
117157

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

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Understanding how wiki and web part page layouts are mapped to modern page layouts
33
description: Provides detailed information on the mapping of layouts between source pages and target modern client side pages
4-
ms.date: 07/13/2018
4+
ms.date: 04/04/2019
55
ms.prod: sharepoint
66
localization_priority: Priority
77
---
@@ -36,6 +36,14 @@ Source page layout|Target page layout
3636
![header, 3 columns](media/modernize/layout_wiki_h3c.png)|1 column row + 3 column row
3737
![header, 3 columns, footer](media/modernize/layout_wiki_hf3c.png)|1 column row + 3 column row + 1 column row
3838

39+
## Publishing page layout mapping
40+
41+
As publishing pages do not have a fixed layout the default layout manager used by the publishing page transformator does work differently: it generates the needed rows and columns based upon the position of the web parts as defined in the used page layout mapping file. This layout behavior is defined in the mapping file using the `PageLayoutTemplate` attribute, which defaults to `AutoDetect`. If for some reason you don't like the automatic layout generation you can also use the earlier described wiki page layout types.
42+
43+
```XML
44+
<PageLayout Name="WelcomeLinks" AssociatedContentType="" PageLayoutTemplate="AutoDetect" PageHeader="Custom">
45+
```
46+
3947
## Overriding the default layout transformation
4048

4149
If for some reason you want to transform layouts differently then you can plug in your own layout transformation component as is shown in below snippet:

0 commit comments

Comments
 (0)