0

On SP 2016 on-prem I am trying to write a console application to upload files, mainly display templates.

I create a dummy site collection, and upload display template in "_catalogs/display templates/myfolder", and try to extract out the xml in order to be able to add dislpay templates programatically by using the command for apply template.

I tried this for extracting the schema:

Get-PnPProvisioningTemplate -Out C:\temp\pnptest\nytest.xml -Handlers Files

and this

Get-PnPProvisioningTemplate -Out C:\temp\pnptest\nytest.xml -Handlers All

None of these seems to work for giving me the schema xml for provisioning display templates. Actually I can not find anything related to my display templates in the xml. How can I upload display templates by using pnp ? Please advice.

  • Not sure though but try this : Get-PnPProvisioningTemplate -PersistBrandingFiles -PersistPublishingFiles -PersistComposedLookFiles -IncludeNativePublishingFiles -Out D:\demo.xml – DvG Jul 9 '18 at 12:17
  • -PersistComposedLookFiles is obsolete. I got the page layouts and masterpages from the catalogs, but no display templates :(. Thanks for the comment though :) – Ilyas Jul 9 '18 at 12:39
  • Yes, -PersistBrandingFiles is the latest. – DvG Jul 9 '18 at 12:50
1

I did some research on this and it seems it is not yet included in PnP Powershell. The suggestion was raised, but no inclusion in pnp-powershell till date for supporting display templates.

Issue Reference

So, answer to your question is: Please try SharePoint powershell cmdlets for migrating your custom display templates. Here is a very good blog for uploading the display templates using powershell

Cheers!

  • 1
    Thanks. I already have the functionality to upload display templates using pure powershell, but we wanted to convert the project to using PnP, and it is very dissapointing that they don't support uploading of display templates - which is one of the most central functionalities of SharePoint. Nevertheless thank you for the answers. – Ilyas Jul 9 '18 at 12:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.