pnpframework icon indicating copy to clipboard operation
pnpframework copied to clipboard

Not able to edit the modern Page created using PnP Powershell

Open rajkumar6193 opened this issue 1 year ago • 7 comments

I created a modern pages using PnP powershell but when i tried to edit it is showing an error. ![image](h Capture ttps://github.com/pnp/pnpframework/assets/115466015/88490127-253e-475e-bec2-ff8fb6170061)

Script i used is

Add-PnPPage -Title

-Name <title> -LayoutType Article -HeaderLayoutType NoImage -CommentsEnabled:$false -Publish:$true

rajkumar6193 avatar Mar 26 '24 13:03 rajkumar6193

We are using PnpFramework nuget package and have the same issue

nm-sys avatar Apr 01 '24 10:04 nm-sys

I am also having this issue, is there an updated option?

JMTechno avatar May 23 '24 16:05 JMTechno

It's an Microsoft issue and happens only if create blank page. Including CanvasLayout property into the request fixes the issue

nm-sys avatar May 24 '24 14:05 nm-sys

Is there a way to fix it after the fact? I indeed created it and then applied the settings as per what i found on the web, thanks.

WF-Personal avatar May 24 '24 14:05 WF-Personal

Is there a way to fix this afterwards without having to redo the page. I have tried a few things, but for each i have to start over and using the commands i have will cuase it to break again.

JMTechno avatar May 25 '24 18:05 JMTechno

@JMTechno @rajkumar6193 @WF-Personal @nm-sys

Adding a page section fixed this issue for me. Try adding this just after you create a page

#create a page $page = Add-PnPPage -Name "This is page Name" -LayoutType Article

#create a section below to fix the issue Add-PnPPageSection -Page $page -SectionTemplate OneColumn -Order 1

nirav-raval avatar Jul 18 '24 15:07 nirav-raval

Awesome, I have to update the script for some other stuff so I will test that and get back to you. Thanks so much, makes sense actually.

@.https://whitefox.com/ John Moleski IT Project Manager 587 434 6001 @. 587 323 5888 @.*** @.@.> @.*** whitefox.comhttps://whitefox.com/ [https://whitefox.com/email-banner/solutions-fit.png] Business office: Whitefox Technologies Canada Ltd - Suite 410 - 1824 Crowchild Trail NW, Calgary, AB T2M 3Y7, Canada Company No: 641175-4 Voted as one of the 50 Hottest Companies in the Advanced Bioeconomy, The Digest. Named as one of the Sunday Times Top 10 Green Tech companies to watch. Winner, BusinessGreen, International Impact Award: Energy Efficient Ethanol Plants. Winner, Clean Energy Awards: Most Efficient Biofuels Separation Technology Provider. This message and any files transmitted with it are intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited and you are requested to notify the sender immediately. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice.

From: Nirav Raval @.> Sent: Thursday, July 18, 2024 9:22 AM To: pnp/pnpframework @.> Cc: John Moleski @.>; Comment @.> Subject: Re: [pnp/pnpframework] Not able to edit the modern Page created using PnP Powershell (Issue #1000)

External Message!

Adding a page section fixed this issue for me. Try adding this just after you create a page

#create a page $page = Add-PnPPage -Name "This is page Name" -LayoutType Article

#create a section below to fix the issue Add-PnPPageSection -Page $page -SectionTemplate OneColumn -Order 1

Ref:

Reply to this email directly, view it on GitHubhttps://github.com/pnp/pnpframework/issues/1000#issuecomment-2236848751, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A6QRXNUB7GOEISJXBRCD3HDZM7MQBAVCNFSM6AAAAABFI64YTOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZWHA2DQNZVGE. You are receiving this because you commented.Message ID: @.@.>>

WF-Personal avatar Jul 18 '24 15:07 WF-Personal