1

I need to copy news templates from one modern site to many others, automatically. I soon realized that the template newspages is stored in Sitepages/Templates on a site.

Using PNP Copy file I can copy the template files to any site I want:

Connect-PnPOnline -Url "https://contoso.sharepoint.com/sites/DevTemplate"
Copy-PnPFile -SourceUrl "Sitepages/Templates" -TargetUrl "/sites/Dev_Test21/Sitepages" -OverwriteIfAlreadyExists -Force

Now to the issue, when I copy the files to a new site with newsfeed, I cannot use the template pages that I copy. They just wont show up even if the Template folder is there with items in it.enter image description here

If I then manually creates ONE template ("ik" on pic below), the copied files also shows because they are in the Sitepages/templates already. It's like I need to create one manually to enable the template function at all.

Any ideas or anyone who managed to copy Sharepoint news templates between sites? enter image description here

1 Answer 1

0

Per my test, it's the same behavior with you, I think this is by design.

It's necessary to have at least one page template in the target site first.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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