|
1 | 1 | ---
|
2 | 2 | title: Understanding and configuring the publishing page transformation model
|
3 | 3 | description: Provides detailed guidance on how to configure and use the publishing page transformation model
|
4 |
| -ms.date: 06/06/2019 |
| 4 | +ms.date: 06/24/2019 |
5 | 5 | ms.prod: sharepoint
|
6 | 6 | localization_priority: Normal
|
7 | 7 | ---
|
@@ -102,7 +102,14 @@ Let's analyze how a page layout mapping is configured in the page layout mapping
|
102 | 102 | </Field>
|
103 | 103 | </WebParts>
|
104 | 104 | <WebPartZones>
|
105 |
| - <WebPartZone Row="2" Column="1" Order="1" ZoneId="g_0C7F16935FAC4709915E2D77092A90DE" ZoneIndex="0"/> |
| 105 | + <WebPartZone Row="2" Column="1" Order="1" ZoneId="g_0C7F16935FAC4709915E2D77092A90DE" ZoneIndex="0"> |
| 106 | + <!-- Optional element, only needed if you want to use custom position of the web parts coming from a web part zone --> |
| 107 | + <WebPartZoneLayout> |
| 108 | + <WebPartOccurrence Type="Microsoft.SharePoint.WebPartPages.ContentEditorWebPart, Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Row="3" Column="2"/> |
| 109 | + <WebPartOccurrence Type="Microsoft.SharePoint.WebPartPages.ContentEditorWebPart, Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Row="3" Column="1" Order="2"/> |
| 110 | + <WebPartOccurrence Type="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart, Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Row="3" Column="1" Order="1"/> |
| 111 | + </WebPartZoneLayout> |
| 112 | + </WebPartZone> |
106 | 113 | </WebPartZones>
|
107 | 114 | <FixedWebParts>
|
108 | 115 | <WebPart Row="1" Column="2" Order="1" Type="Microsoft.SharePoint.WebPartPages.ContentEditorWebPart, Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
|
@@ -204,6 +211,18 @@ If the page layout contains web part zones then these must be defined here. This
|
204 | 211 | - **Column**: the column you want to put the web parts hosted in this zone in. Needs to be 1, 2 or 3.
|
205 | 212 | - **Order**: order in the defined row/column for the web parts hosted in this zone
|
206 | 213 |
|
| 214 | +Sometimes publishing pages have multiple web parts in a web part zone and you do want to position each web part differently on the target page. You can do that by using the optional WebPartZoneLayout element: |
| 215 | + |
| 216 | +```Xml |
| 217 | +<WebPartZoneLayout> |
| 218 | + <WebPartOccurrence Type="Microsoft.SharePoint.WebPartPages.ContentEditorWebPart, Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Row="3" Column="2"/> |
| 219 | + <WebPartOccurrence Type="Microsoft.SharePoint.WebPartPages.ContentEditorWebPart, Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Row="3" Column="1" Order="2"/> |
| 220 | + <WebPartOccurrence Type="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart, Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Row="3" Column="1" Order="1"/> |
| 221 | +</WebPartZoneLayout> |
| 222 | +``` |
| 223 | + |
| 224 | +The above definition will have as a result that the first ContentEditorWebPart will go to row 3, column 2. The second ContentEditorWebPart will be put in row 3, column 1 with order 2 and the first XSLTListView web part will end up in row 3, column 1 with order 1. You can define as many WebPartOccurrence elements as needed, if there is no corresponding web part in the web part zone then the WebPartOccurrence element will be ignored. If there's a web part in the web part zone which is not listed as a WebPartOccurrence element then that web part will get it's row, column and order information from the WebPartZone element. |
| 225 | + |
207 | 226 | ### FixedWebParts element
|
208 | 227 |
|
209 | 228 | Sometimes page layouts contain "fixed" web parts, this are web parts which are hard coded inside the page layout and therefore these are present on all pages that use the page layout. As there's no API's to detect these "fixed" web parts they need to be defined as part of the page layout mapping model.
|
@@ -344,3 +363,22 @@ When a page has a page header image that image will also be used as a page previ
|
344 | 363 |
|
345 | 364 | > [!Note]
|
346 | 365 | > Controlling the page preview image was introduced with the May 2019 release.
|
| 366 | +
|
| 367 | +### I want to use different defaults for the QuickLinks web part |
| 368 | + |
| 369 | +When transformation results in a modern QuickLinks web part (e.g. for transformation of the SummaryLinkWebPart) then the page transformation framework will use a default base configuration for the QuickLinks web part. If you, however, want a different configuration then you can do that by specifying the QuickLinksJsonProperties property. Wrap the encoded JSON properties in a StaticString function as shown in this sample: |
| 370 | + |
| 371 | +```XML |
| 372 | +<WebParts> |
| 373 | + ... |
| 374 | + <Field Name="SummaryLinks" TargetWebPart="Microsoft.SharePoint.Publishing.WebControls.SummaryLinkWebPart, Microsoft.SharePoint.Publishing, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Row="1" Column="2"> |
| 375 | + <!-- No function specified, means the content of the PublishingPageContent field will be assigned to the value of the first listed web part property --> |
| 376 | + <Property Name="SummaryLinkStore" Type="string" /> |
| 377 | + <Property Name="Title" Type="string" Functions="EmptyString()"/> |
| 378 | + <Property Name="QuickLinksJsonProperties" Type="string" Functions="StaticString('{"isMigrated": false, "layoutId": "Button", "shouldShowThumbnail": true, "buttonLayoutOptions": { "showDescription": false, "buttonTreatment": 1, "iconPositionType": 2, "textAlignmentVertical": 1, "textAlignmentHorizontal": 2, "linesOfText": 2}, "listLayoutOptions": { "showDescription": false, "showIcon": true}, "waffleLayoutOptions": { "iconSize": 1, "onlyShowThumbnail": false}, "hideWebPartWhenEmpty": true}')" /> |
| 379 | + </Field> |
| 380 | + ... |
| 381 | +</WebParts> |
| 382 | +``` |
| 383 | + |
| 384 | +The JSON in the sample shows all the possible configuration options you can set, but you can however also just define the ones you need. As long as the JSON is valid and the structure is maintained your custom QuickLinks configuration will be picked up. |
0 commit comments