Published Date: 27 November, 2020

Clone Sitecore Item

Cloning a Sitecore item means coping that Sitecore item at the same or different location and inherit its fields value from the base/source Sitecore item. It means following:

  1. The newly cloned item would have same fields values that the source item fields have.
  2. Since the newly item inherits from the source item, if we are changing the value of the source item fields value, newly cloned item's fields value will also change.

You can clone Sitecore items or entire branch (item and its descendants) of items.

Let's check this theory:

  1. Select your item from the Sitecore content tree that you would like to clone.
  2. Chose Clone option from the CONFIGURE menu.
  3. Select your destination location you would like to clone.
  4. 4. Click on Clone.

After cloning the item when you select that newly created items, you will find that field's label has an additional text "[original value]:"

http://www.tekkishare.com

Now change the values of fields in the source/base item and check fields value in the cloned item. You can find the updated values (new values of the source/base item).

Unclone Sitecore Item

Unclone is require when you would like to break the inheritance. It means after UnClone, you would no more find the changed fields value in the newly cloned item after UnClone. Even you would not see "[original value]:" with the fields label.

There are two ways to unclone Sitecore item:

  1. Select the newly cloned item and click on the UnClone option from the CONFIGURE menu.
  2. Select the newly cloned item and change the field's value and save the changes.

How do Sitecore establish this binding/inheritance?

You might be thinking that how the Sitecore knows that the current selected item is cloned or not? If it is cloned item then which one is the source item or to whom you have cloned? Without knowing the answers of these questions, Sitecore can't fetch the values of the source item values of fields and display in the cloned item fields value.

As you know, Sitecore have many OOTB (out of the box) fields that you can show by selecting the checkbox Standard fields from the VIEW menu. There is a section called Advance. Here you can find two fields that contain the reference of the base/source item if the selected item is cloned.

http://www.tekkishare.com

Sitecore recommendation

Recently Sitecore publish an article regarding cloning feature. You can find this link at the end of this blog. Sitecore is saying that it might affect the application performance so recommending that you should disable this feature in all the Sitecore instances except ContentManagement and Standalone.

We can disable clone feature using patch configuration file.

<setting name="ItemCloning.Enabled" value="false" />
<setting name="ItemCloning.Enabled" role:require="ContentManagement or Standalone">
<patch:attribute name="value">true</patch:attribute>
</setting>

Before disabling this cloning feature we must know that either this feature is being used currently or not. To know this we can use the following SQL Query:

SELECT COUNT(*) as NumberOfClones
FROM [dbo].[Fields]
WHERE (FieldId = '1B86697D-60CA-4D80-83FB-7555A2E6CE1C' OR FieldId = '19B597D3-2EDD-4AE2-AEFE-4A94C7F10E31') AND ([Value] <> '')

If the NumberOfClones is equal to 0, it means it is not being used.



References: