0

I need to change the template of multiple items in a folder but need to retain the field values and rendering and layout details. I was able to change the template and retain the field values. But how do I retain the renderings and layout after changing the template?enter image description hereenter image description hereenter image description here

0

Renderings and Layout are just more fields on the template. They are a combination of the __Renderings and __Final Renderings fields.

Simply add those fields to your -FieldsToCopy parameter:

Set-ItemTemplate -Item $_ -TemplateItem $targetTemplate `
    -FieldsToCopy @{ `
        "__Renderings" = "__Renderings" `
        "__Final Renderings" = "__Final Renderings" `
    }
4
  • Above code is giving error and still unable to copy the the renderings and layout. Nov 10 at 14:34
  • 1
    It is double underscore for both. __Renderings and __Final Renderings Nov 10 at 14:54
  • Thanks Richard and Hishaam. Worked like charm. For standard values and insert options should I do the same thing? Nov 10 at 15:34
  • For some reason I am losing the renderings on the page This is happening randomly on items Dec 1 at 21:04

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.