You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to use the Add-PnPPageSection cmdlet to add a webpart to a news item page, if there is a full-width section with any webpart, other than a banner, already on the page then I get an error
Expected behavior
I expect the cmdlet to add a new section to the news item page
Actual behavior
I receive the following error and the section is not added You cannot host text controls inside a one column full width section, only an image web part or hero web part are allowed
Steps to reproduce behavior
Create a news item page with multiple sections
Make one of the sections a Full-Width section, with an image webpart
Try to run the Add-PnPPageSection cmdlet for that page
The script I have involves finding any file created in the last day $Files = $Files | Where-Object { $_.TimeCreated -gt (Get-Date).AddDays(-1) }
Then cycling through them, working out if the page has a specific webpart in it already
If it doesn't then add a new section, and add the webpart to that section
This is the command I am trying to run Add-PnPPageSection -Page $Page -SectionTemplate OneColumn -ZoneEmphasis 2 -Order ($Page.Sections.Count + 1)
In essence finding out how many sections the page currently has and adding a new one
But it gives me the error mentioned previously, which is confusing as I am not trying to add text controls to a full width section, but just add a new section entirely.
What is the version of the Cmdlet module you are running?
PnP.Powershell 2.12
Which operating system/environment are you running PnP PowerShell on?
Windows
The text was updated successfully, but these errors were encountered:
JamesDerrickHH
changed the title
[BUG] Add-PnPPageSection fails when a full-width section is on the page
[BUG] Add-PnPPageSection fails when a full-width section with image webpart is on the page
Oct 23, 2024
JamesDerrickHH
changed the title
[BUG] Add-PnPPageSection fails when a full-width section with image webpart is on the page
[BUG] Add-PnPPageSection fails when a full-width section with non-banner webpart is on the page
Oct 23, 2024
Reporting an Issue or Missing Feature
When I try to use the Add-PnPPageSection cmdlet to add a webpart to a news item page, if there is a full-width section with any webpart, other than a banner, already on the page then I get an error
Expected behavior
I expect the cmdlet to add a new section to the news item page
Actual behavior
I receive the following error and the section is not added
You cannot host text controls inside a one column full width section, only an image web part or hero web part are allowed
Steps to reproduce behavior
Create a news item page with multiple sections
Make one of the sections a Full-Width section, with an image webpart
Try to run the Add-PnPPageSection cmdlet for that page
The script I have involves finding any file created in the last day
$Files = $Files | Where-Object { $_.TimeCreated -gt (Get-Date).AddDays(-1) }
Then cycling through them, working out if the page has a specific webpart in it already
If it doesn't then add a new section, and add the webpart to that section
This is the command I am trying to run
Add-PnPPageSection -Page $Page -SectionTemplate OneColumn -ZoneEmphasis 2 -Order ($Page.Sections.Count + 1)
In essence finding out how many sections the page currently has and adding a new one
But it gives me the error mentioned previously, which is confusing as I am not trying to add text controls to a full width section, but just add a new section entirely.
What is the version of the Cmdlet module you are running?
PnP.Powershell 2.12
Which operating system/environment are you running PnP PowerShell on?
The text was updated successfully, but these errors were encountered: