Sunday, March 13, 2016

New Cloning Related Features - Sitecore 8.1 Update-2 Settings - Part 1


Today I went through the configuration changes for the Sitecore 8.1 rev. 160302 (Update-2), which contains following config change to App_Config\Sitecore.config file, which I will go through one by one.

ItemCloning.DeleteClonesWithOriginalItem Setting

<setting name="ItemCloning.DeleteClonesWithOriginalItem" value="false" /> 

This is another very useful functionality added into 8.1 update-2, where cloned items will be also deleted when the source item is deleted.

In earlier version, when a Source item is deleted, Sitecore converts its clones into normal items, and did NOT provide any option to delete clones at the same time.

ItemCloning.DeleteClonesWithOriginalItem set to "false"


But, with this setting set to 'true', when the source / original item is deleted, clones of that item will also get deleted.

ItemCloning.DeleteClonesWithOriginalItem set to "true"

Video explaining the usage of this setting can be found in my "Sitecore for Dummies" YouTube channel.


Following is the description Sitecore has provided with this config setting.

 <!--  ITEM CLONING - DELETE CLONES WITH ORIGINAL ITEM    
Specifies whether item clones should be deleted when the original item is deleted. If true, when the original item is deleted all its clones are deleted and not just uncloned.    
Default value: false
-->

For a one of my clients which Sitecore 6.6 few years back, I had to re-write the item delete functionality, so that it included this option.

ItemCloning.ForceUpdate.ChangeTemplate Setting

<setting name="ItemCloning.ForceUpdate.ChangeTemplate" value="false" />
In earlier versions of Sitecore, templates of clones were not updated, once the source item template is changed. With this new setting set to true, clones will also get updated with the source/original item template changes.

Video explaining the usage of this setting can be found in my "Sitecore for Dummies" YouTube channel.

Following is the description give to the setting in Sitecore configuration file
<!--  ITEM CLONING - FORCE UPDATE - CHANGE TEMPLATE
       Specify whether clones should be updated automatically when a different template is selected for the original item.
       Note: If true, all the clones of the original item are updated automatically.
       Default value: false
 -->

ItemCloning.RelinkClonedSubtree Setting

<setting name="ItemCloning.RelinkClonedSubtree" value="false" />

As you can see from the config description below, this will re-link all the links on items, within the cloning sub-tree.
<!--  ITEM CLONING - RELINK CLONED SUBTREE    
Indicates that after cloning an item tree structure, all the internal links inside the cloned structure should be re-linked to point to the items in the cloned sub-tree. When the setting value is false, the links in the cloned structure will still link to the items in the original structure.    
Default value: false
-->
This setting is very useful one, when doing content structuring/cloning a new node/etc. Earlier, when a new clone node was created, we had to run a custom written tool to modify the links to be match/used items within the newly cloned item sub-tree.

Video explaining the usage of this setting can be found in my "Sitecore for Dummies" YouTube channel.



Happy Sitecore!!

5 comments:

  1. Apart from doing it manually . it will make life easy for content authors and developer. Very useful changes

    ReplyDelete
  2. I am using sitecore 8 but this (ItemCloning.RelinkClonedSubtree Setting) seems not working for me.

    ReplyDelete
    Replies
    1. are you using Sitecore 8.1 ?
      This feature is introduced in Sitecore 8.1 update-2

      Delete
  3. Hi Chaturanga,

    I followed the steps as mentioned by you for "ItemCloning.RelinkClonedSubtree Setting", though I'm not able to replicate the same on my end.

    The reason I think is that it is showing the cloned item like "Link field [original value]:", so it must be picking the original item.

    Can you please suggest what to do?

    Thanks,
    Robin.

    ReplyDelete
  4. hi Robin,
    is your "Link Field" is pointing to a item in the sub-tree, where you are going to clone.
    i.e. as below, assume your LinkField field is in "originalItem" and its pointing to "subitem1" item

    -originalItem
    - subitem1

    ReplyDelete