Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-pnppagewebpart does not work on home.aspx or topichome.aspx with Quicklinks webpart #1574

Open
1 task done
seegerp2000 opened this issue Nov 10, 2024 · 1 comment
Open
1 task done
Assignees
Labels
area: pages API 📄 Working with modern pages question Further information is requested

Comments

@seegerp2000
Copy link

Category

  • Bug

Describe the bug

When trying to update a QuickLinks webpart using Powershell on either the Home.aspx or TopicHome.aspx page which contains a QuickLinks webpart I receive the following error:

 Set-PnPPageWebPart -Page $MyPage -Identity $tmp -PropertiesJson $ …
 |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | You cannot host text controls inside a one column full width section, only an image web part or hero web part are allowed

Using the same command to update any other page I have created with a QuickLinks webpart works fine. FYI - I have validated my json file on a random page.aspx containing a QuickLink webpart to rule out some issue with the json file itself. It works fine on regular page.aspx files.

Steps to reproduce

Set-PnPPageWebPart -Page $MyPage -Identity $tmp -PropertiesJson $JSONObj
$page="Home.aspx" or "TopicHome.aspx" on a given site collection where home has empty Quicklinks webpart
$tmp is the InstanceID of the QuickLinks webpart on $page
$JSONObj is the json containing links to the buttons I want to config in the QuickLinks

Expected behavior

I expected the QuickLinks webpart on the page to update with links associated with buttons on the webpart control.

Environment details (development & target environment)

  • SDK version: NA (I think)
  • OS: Windows 10
  • SDK used in: NA
  • Framework: PowerShell 7.4.6
  • Browser(s): Chrome
  • Tooling: VS Code
  • Additional details: The more context you can provide, the easier it is (and therefore quicker) to help.

Additional context

Thanks for your contribution! Sharing is caring.
AddWebPartPrototypeSanitized.txt

@jansenbe jansenbe added the area: pages API 📄 Working with modern pages label Nov 18, 2024
@jansenbe
Copy link
Contributor

@seegerp2000 : I did several changes to the Pages API today, would recommend testing again tomorrow with the nightly builds of PnP Core SDK and PnP PS. Also be aware of the fact that pages changed the header implementation, the header now is a Banner web part in a full width section on the page...if you're trying to add your quicklinks web part in the section containing the header then that will fail by design given full width sections only allow certain type of controls (and quicklinks is not one of them). You can test with adding the sectionIndex 2 instead of 1.

@jansenbe jansenbe self-assigned this Nov 18, 2024
@jansenbe jansenbe added the question Further information is requested label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: pages API 📄 Working with modern pages question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants