Forum Discussion
4lexius4 world
Mar 02, 2020Copper Contributor
PnP Page Provisioning Images are not imported in the new provisioned site.
Hi there, I'm trying to provision a custom page from one site to another using: Apply-PnPProvisioningTemplate -Path c:\temp\myPage.pnp all custom webpart are correctly added but the images (like ...
- Mar 31, 2020
Problem solved! thanks to the great Paolo Pialorsi , who provided us with the solution.
Sharing below the solution in case it can be useful in similar cases:1) First Export the client side page using the -PersistBrandingFiles attribute.
Export-PnPClientSidePage -Identity "TestPage.aspx" -Out .\single-page.xml -PersistBrandingFiles
2) Convert the xml and related content in an unique file pnp.
Convert-PnPFolderToProvisioningTemplate -Folder .\ -Out c:\temp\single-page.pnp3) Then connect to target site and apply the page provisioning.
Thanks Carlos for your time, and thank Paolo for the solution!
Cheers,
Alessio
Carlos_Marins
Mar 25, 2020Iron Contributor
Hey 4lexius4 world ,
In this case, I think you need to download the image you're using as a Banner for the page - with the name "92504-thumbnailAF.png", keep it in the same directory as your XML, and add the following code after "</pnp:ClientSidePages>":
<pnp:Files>
<pnp:File src="./92504-thumbnailAF.png" Folder="SiteAssets/SitePages/CoolPage" Overwrite="true" Level="Published" />
</pnp:Files>
<pnp:File src="./92504-thumbnailAF.png" Folder="SiteAssets/SitePages/CoolPage" Overwrite="true" Level="Published" />
</pnp:Files>
4lexius4 world
Mar 31, 2020Copper Contributor
Problem solved! thanks to the great Paolo Pialorsi , who provided us with the solution.
Sharing below the solution in case it can be useful in similar cases:
1) First Export the client side page using the -PersistBrandingFiles attribute.
Export-PnPClientSidePage -Identity "TestPage.aspx" -Out .\single-page.xml -PersistBrandingFiles
2) Convert the xml and related content in an unique file pnp.
Convert-PnPFolderToProvisioningTemplate -Folder .\ -Out c:\temp\single-page.pnp
3) Then connect to target site and apply the page provisioning.
Thanks Carlos for your time, and thank Paolo for the solution!
Cheers,
Alessio