pnpframework icon indicating copy to clipboard operation
pnpframework copied to clipboard

Unable to create a page without header / banner webpart

Open diabhoil opened this issue 1 year ago • 1 comments

I am trying to create a template with pages without a header. So I create a page, remove the banner webpart with the section. Save the page and publish it. All is fine. Then I create the template with PnP.PowerShell (Get-PnpSiteTemplate -Out teplate.xml -IncludeAllPages).

When I then invoke the template again, my pages will have the default banner webpart again on the page.

The XML created for a page without header will have this block:

<pnp:Header Type="Default" LayoutType="FullWidthImage" ShowTopicHeader="false" ShowPublishDate="false" ShowBackgroundGradient="false" TopicHeader="" AlternativeText="" Authors="" AuthorByLineId="-1" />

The result will look like this:

Image

Removing the header line in xml will result in something like this (same goes for a header with type = None):

Image

It should look like this (no banner at all):

Image

Some additionally information: PnP.PowerShell Version: 2.99.175-nightly

Having the same problems using the current release of PnP.Framework Nuget package (1.17.0 with PnP.Core 1.14.0) in C#

diabhoil avatar Mar 24 '25 16:03 diabhoil

I know that there is a workaround where I set the page layout to "Home". While this will remove the banner webpart on the page, "Home" pages can not be saved as template and maybe missing more features which normal pages will have.

It should be possible to create a normal article page without a header (like it is possible in the SPO ui).

diabhoil avatar Mar 25 '25 11:03 diabhoil