pnp / pnpframework

PnP Framework is a .NET library targeting Microsoft 365 containing the PnP Provisioning engine and a ton of other useful extensions
https://pnp.github.io/pnpframework/
MIT License
206 stars 143 forks source link

Failing to provision page with PageTitle web part in full-width section #1038

Open cwparsons opened 2 months ago

cwparsons commented 2 months ago

When exporting a newly created, blank page, the PageTitle web part is added to a OneColumnFullWidth section. When trying to provision this content, it fails, giving the error You cannot host text controls inside a one column full width section, only an image web part or hero web part are allowed.

I suspect it is due to changes with the New Banner web part.

Example XML from a newly created page:

<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2022/09/ProvisioningSchema">
  <pnp:Preferences Generator="PnP.Framework, Version=1.16.0.0, Culture=neutral, PublicKeyToken=0d501f89f11b748c" />
  <pnp:Templates ID="CONTAINER-TEMPLATE-2EF375AEC7E246118F0081FAA442F36E">
    <pnp:ProvisioningTemplate ID="TEMPLATE-2EF375AEC7E246118F0081FAA442F36E" Version="0" Scope="Undefined">
      <pnp:ClientSidePages>
        <pnp:ClientSidePage PromoteAsNewsArticle="false" PromoteAsTemplate="false" Overwrite="true" EnableComments="false" Title="Test" ThumbnailUrl="" PageName="Test.aspx">
          <pnp:Header Type="Default" LayoutType="FullWidthImage" ShowTopicHeader="false" ShowPublishDate="false" ShowBackgroundGradient="false" TopicHeader="" AlternativeText="" Authors="" AuthorByLineId="-1" />
          <pnp:Sections>
            <pnp:Section Order="1" Type="OneColumnFullWidth">
              <pnp:Controls>
                <pnp:CanvasControl WebPartType="PageTitle" JsonControlData="{&quot;id&quot;: &quot;cbe7b0a9-3504-44dd-a3a3-0e5cacd07788&quot;, &quot;instanceId&quot;: &quot;73058164-effa-4b27-be24-dd2759d41de0&quot;, &quot;title&quot;: &quot;Banner&quot;, &quot;description&quot;: &quot;Show a banner with title and author information&quot;, &quot;dataVersion&quot;: &quot;1.5&quot;, &quot;properties&quot;: {&quot;imageSourceType&quot;:2,&quot;title&quot;:&quot;Test&quot;,&quot;textAlignment&quot;:&quot;Left&quot;,&quot;showPublishDate&quot;:false,&quot;authors&quot;:[{&quot;id&quot;:&quot;i:0#.f|membership|name@example.onmicrosoft.com&quot;,&quot;upn&quot;:&quot;name@example.onmicrosoft.com&quot;,&quot;email&quot;:&quot;name@example.onmicrosoft.com&quot;,&quot;name&quot;:&quot;Name&quot;,&quot;role&quot;:&quot;&quot;}],&quot;showTopicHeader&quot;:false,&quot;authorByline&quot;:[&quot;i:0#.f|membership|name@example.onmicrosoft.com&quot;],&quot;layoutType&quot;:&quot;CutInShape&quot;,&quot;isFullWidth&quot;:true,&quot;topicHeader&quot;:&quot;&quot;,&quot;enableGradientEffect&quot;:true,&quot;isDecorative&quot;:true}, &quot;serverProcessedContent&quot;: {&quot;htmlStrings&quot;:{},&quot;searchablePlainTexts&quot;:{},&quot;imageSources&quot;:{&quot;imageSource&quot;:&quot;/_layouts/15/images/sleektemplateimagetile.jpg&quot;},&quot;links&quot;:{},&quot;customMetadata&quot;:{&quot;imageSource&quot;:{}}}, &quot;dynamicDataPaths&quot;: {}, &quot;dynamicDataValues&quot;: {}}" ControlId="cbe7b0a9-3504-44dd-a3a3-0e5cacd07788" Order="1" Column="1" />
              </pnp:Controls>
            </pnp:Section>
            <pnp:Section Order="2" Type="OneColumn">
              <pnp:Controls>
                <pnp:CanvasControl WebPartType="Text" ControlId="1212fc8d-dd6b-408a-8d5d-9f1cc787efbb" Order="1" Column="1">
                  <pnp:CanvasControlProperties>
                    <pnp:CanvasControlProperty Key="Text" Value="" />
                  </pnp:CanvasControlProperties>
                </pnp:CanvasControl>
              </pnp:Controls>
            </pnp:Section>
          </pnp:Sections>
        </pnp:ClientSidePage>
      </pnp:ClientSidePages>
    </pnp:ProvisioningTemplate>
  </pnp:Templates>
</pnp:Provisioning>
marcoschmucker commented 1 month ago

We have the same thing on tenants where the new section possibilities and banner webparts are available - but not too many have that at this point of time.

Workaround: Remove the full width section in page templates, use a normal section with Text webpart. After provisioning make sure people add the full width section with banner. Not nice.

Any updates? @cwparsons

dfrancoeur commented 3 weeks ago

Any updates on this?