Sitecore do not copy

It seems to be a good practice and that has been proven on many solutions that we have built.

A very default page structure would look like this:

However, there is one annoying issue related to that. When you copy or duplicate the page, renderings which are assigned to the copied page will remain referring to the data source items of an original page.

In a default scenario of page duplicating, the copied page would look like this:

It adds even more confusion when editor works from within the experience editor as the page looks correct, but when editing, the content changes go to original items and both original and copied page are updated with new content.

Fortunatelly, there is a solution to that. We have implemented a small Sitecore module that solves this issue by re-mapping page-relative data sources to copied ones on item:copied event.

If we visualize what it does – the data source references will be re-mapped from original page to a copied one like this:

Please have a look at our github Pintle.ItemCopyExtensions

We have also extracted that to a nuget package so all you need to do is to run this command from Nuget Package Manager console:

Install-Package Pintle.ItemCopyExtensions

This will add a dll and a config file to your solution which will handle the problem for you.

Enjoy and spread a word.

Share article
See also

Sitecore 10 Content Serialization. Do we still need Unicorn?

Read more Volodymyr Hil 10.08.2020

Changes to link generation in Sitecore 9.3

Read more Volodymyr Hil 16.04.2020
Content migration sitecore

Sitecore content migration – a technical guide

Read more Volodymyr Hil 04.11.2019
Sitecore benefits in the AWS cloud

Sitecore to AWS Case: Cloud as a Transition

Read more Motiejus Bagdonas 21.10.2019
Pintle.Packager – Sitecore Package Generator

Pintle.Packager – Sitecore Package Generator

Read more Volodymyr Hil 07.10.2019