What problem does this solve?
Copy or clone an item with descendants
- Have a page with references to child items (rendering datasource, internal link, etc.)
- Clone or copy the item (which copies descendants)
- The new copies now reference the old child items.
Create an item from a branch template
- Have a branch template with references to child items (rendering datasource, internal link, etc.)
- Create a new item from the branch template
- The new item now references the child items in the branch template, not the newly created child items.
How do I use it?
There is no special action necessary. Simply copy items or create items from branch templates like normal, and all references within the copied/created items will be automatically updated to reference the new items.
How does it work?
There are multiple extension points to implement this functionality…
item:added
event handler added to update references when creating an item from a branch templateItemDuplicate
processor for theuiDuplicateItem
pipeline has been replaced and extended to update references when duplicating an item- Processor added to the
uiCopyItems
anduiCloneItems
pipelines
Credit
Implementation is based heavily on this article by Uli Weltersbach.