Nov 14 2019 12:13 PM
I am trying to create a ClientSidePage in C#. I have been able to make the page, but I can't figure out how to remove the image from the Page Banner. The option exists to remove the image and keep the banner when in the UI's edit mode.
clientSidePage.PageHeader.LayoutType = ClientSidePageHeaderLayoutType.NoImage;
... but that has no effect.
How do I remove the image from the page banner without removing the entire banner?
Thanks in advance,
AS
Nov 22 2019 01:07 AM
@AS911 I have the same issue. Original page has no banner and image, after applying the template the page has a banner and no image.
Nov 25 2019 09:40 AM
Hey guys,
Just to say that with the PnP Powershell I was able to update the page header, setting it to NoImage. You can create the page and then use the following code:
Nov 27 2019 07:23 AM
@Carlos_Marins Thanks for getting back.
Setting it to "1" (casted to the ClientSidePageHeaderLayoutType, since that is the type that CSOM is looking for) still has no effect, unfortunately.
We are currently opting to make the change through JS instead. I'll try to give an update where that leads.
Nov 27 2019 09:01 AM
Hi @AS911,
Are you using the CSOM library? Which version? Using the latest PnP PowerShell I was able to save a page with the Header set to NoImage.
I am also looking for a way to have a parameter -HeaderLayoutType(something like that) included in the Add-PnPClientSidePage so this problem is solved.
Nov 27 2019 12:02 PM
Hey, @Carlos_Marins.
We are using the latest SharePointPnPCoreOnline (v3.15.1911), which uses the Microsoft.SharePointOnline.CSOM (>= 16.1.19404.12000).
We opted to just remove the page header through an Application Extension SPFx, then have a webpart read the site page properties to create the title as needed.
So problem is "resolved", as in we found an alternate solution that did not involve the PnPClientSidePage commands that suited our needs.
Nov 29 2021 06:00 AM