Insights

Clone And Unclone An Item In Sitecore

What Is A Clone?

In Sitecore, a clone is an item that is not just a copy of the original item, but one that inherits the field values from the original item. If you update a field in the original item, the corresponding field in the clone is also updated.

What Can Be Cloned?

Here are the following items which can be considered for cloning:

  • Complete site
  • Section of site
  • Individual Item

How To Clone An Item?

1st Method

Select the item and go to the Home tab. Click on the arrow of the Duplicate button. Over there you will get the option to clone the item.

Click Duplicate to find the Clone function in Sitecore

2nd Method

In the content tree, select the item that you want to clone . On the Configure tab , in the Clones group, click clone.

Click the Configure tab to find the Clone function in Sitecore

While you clone the item, you will get a prompt to choose the destination of the cloned item. After choosing the destination, cloning will be done with the exact values of the original item.

If you select the clone item in the Content Editor, you notice that the field titles have the [original value] text added. This means that these values match the corresponding values in the original item and are updated if you edit the field in the original item.

Update the Original Value fields to configure a clone in Sitecore

Now if you change the value in the original item, the corresponding value in the cloned item will be changed. This will pass on to all cloned items in the content tree. Even if you clone from a cloned item, the value change in one place will take place in all subsequent cloned items.

If you change the version of the original item, the value will not be placed in the cloned item automatically. You will get an option to clone the next version of the original item. And then it will be changed.

Review items after a new version of the Sitecore items were created

Note - If you clone an item that is in a workflow, the workflow and the Workflow state properties are copied to the clone item. After the workflow fields are copied, the workflow properties of the clone and the workflow properties of the original items are not connected any more. If you change the workflow state of the original item, the workflow state of the clone does not change.

Breaking The Inheritance For A Cloned Item

we can break the inheritance on field level, to break inheritance on the field level, just go to the clone item and update any specific field value. Once we update a specific field value manually for any clone item, that field won’t share/inherit the value from the parent/original item. This is helpful in cases where certain field values to be shared from the parent item, and certain field values managed separately in the clone item.

Manage this text field separately from the clone item in Sitecore

In the above screen shot we can see that Text doesn’t show any original value text because the value was updated directly in the cloned item, but Title still inherits it from the parent item.

How To Get The Cloned Items In The Content Tree?

There is a way by which you will get to know the cloned item by just expanding the Content tree. Open the content tree and right-click on the blank space on the left side of the Content tree options.

Right click the content tree to choose the Cloned Items in Sitecore

An option list will come up and from there choose Cloned Items.

Choose Cloned Items in the menu in the content tree in Sitecore

After this, an icon will be shown beside the item on that blank space. On clicking the icon, the original item will be selected in the content tree.

Select the Cloned item in the content tree just created

How Cloned Item Tracks Changes In A Source Item?

Now the question is how changes from the source item get reflected in cloned items. We need to check standard fields for this. In each item’s standard field, there is Source field in Advanced section. This field stores reference to the source item from which item is cloned.

Field referencing the source item that was Cloned in Sitecore

Note - If the Advanced section is not visible, click the View tab and select the Standard fields check box.

Click standard fields to ensure the Advanced section is visible

What Does It Mean To Unclone?

Once the item is cloned, you will get an option to Unclone it, over there in the Home and configure tab. If you no longer want to have a connection between the original item and the clone, you can unclone the clone item.

How To Unclone A Cloned Item?

Select the clone item you want to unclone. On the Configure tab, in the Clones group, click Unclone.

Click the configure tab to Unclone an item in Sitecore

No field values in the clone item change. The connection between the clone and the original item is removed and the clone becomes a normal content item.

Hey, Developers!

We're on the look out for talented developers to join our team.

Think you have what it takes?