How can we improve Sitecore?

Copy and Duplicate should update datasources and links to copied items

One common way of structuring data in the content tree is to put the component datasources in a folder directly beneath the item (e.g. in a /pagedata folder).

When copying or duplicating an item the new copy of the item still has the datasource point back to the original item. This is confusing for content editors, who go ahead and edit the content only to find it has changed on the original page as well.

At best, the editors have to open the new copy and change all the components on the page to point to the new datasources, which is not fun on a page with a lot of components, esp since Sitecore encourage the use of datasources for components and it is required for personalisation.

Many solutions already exist, including this one from Alen Pelin - https://bitbucket.org/sitecore/sitecore-smart-commands/src

This works very well and works on a multiple of fields as well, such as Link-type fields and links in Rich Text field.

This should be a standard feature of Sitecore, I've never come across a project where this would NOT be the case (but feel feature to enable/disable this using a feature flag in config)

33 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Kamruz Jaman shared this idea  ·   ·  Admin →

    4 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Kamruz Jaman commented  · 

        The restriction on the module linked to will check that the link referenced in a copy is a child of the original item, otherwise it leaves them alone. So it should only update links to the new copies, as you both correctly state.

      • Mark Cassidy commented  · 

        Yea. The algorithm is actually fairly straight forward. If an ItemReference exists TO an Item in copy-batch, then remap to corresponding item in the new location. Otherwise leave alone.

      • James Walford commented  · 

        We've built this as an "Advanced copy" function, but it goes further and localises all sorts of references. The problem is that it can easily turn into a full site crawl if there are no restrictions placed on it.

      • Jason St-Cyr commented  · 

        Completely agree on this one. If not a feature flag, as long as it's a pipeline we can patch it out if needed. I have yet to come across a user who understood why copying something copied all the datasources but did not remap the datasources.

        When implementing, careful of non-copied datasources. References to site-wide elements (such as headers and footers) should not be duplicated and remapped. It should only remap those it made a copy of.

      Feedback and Knowledge Base