Forum Discussion
Adding visual webpart to list display form
I am working on creating a template for my SharePoint 2013 site, using PNP powershell. One of the requests is to create a custom list and add a custom visual webpart to the display form.
I am using:
HI Sergei Gorelik,
I think the issue that you are running into is similar to one I had a while back.
In my case a view on a list was set to the default welcome page when I exported the site and PnP PowerShell wasn't able to handle the web parts on the page as the page used isn't a web part page but a view on a list.
I wouldn't be surpised if you have the same issue as you are using Add-PnPWebPartToWebPartPage to add a web part to a page that isn't a web part page. You could probably add a new page and add a list view web part and then add your custom web parts to that page.
- Sergei GorelikCopper Contributor
Thank you for your feedback, I actually tried adding it to the webpart only page with the same errors. I am thinking that add-webpart commandlet is not able to handle custom visual webparts.