I have been working with Sitecore Data Exchange Framework 1.3 and got into a situation where I wanted to remove all subitems of a specific item without deleting that specific item. For example, let’s consider the below screenshot of Sitecore content tree:
I am working on CD Catalog Pipeline Batch item of Sitecore Data Exchange Framework 1.3 and whenever I click on Run Pipeline Batch button available in Data Exchange Ribbon, it creates multiple items under CD Catalog item from XML file. I am developing and testing custom XML provider for Data Exchange framework thus there is a frequent need to delete all subitems under CD Catalog item except CD Catalog item folder. If I right click on CD Catalog item then Sitecore Context Menu gives me option to delete CD Catalog item which will eventually delete all subitems under it but I don’t want to delete CD Catalog item folder.
Although Sitecore provides an option to delete subitems of a particular item. In this case, I have to follow below steps:
I am working on CD Catalog Pipeline Batch item of Sitecore Data Exchange Framework 1.3 and whenever I click on Run Pipeline Batch button available in Data Exchange Ribbon, it creates multiple items under CD Catalog item from XML file. I am developing and testing custom XML provider for Data Exchange framework thus there is a frequent need to delete all subitems under CD Catalog item except CD Catalog item folder. If I right click on CD Catalog item then Sitecore Context Menu gives me option to delete CD Catalog item which will eventually delete all subitems under it but I don’t want to delete CD Catalog item folder.
Although Sitecore provides an option to delete subitems of a particular item. In this case, I have to follow below steps:
- I have to navigate away from current item CD Catalog Pipeline Batch and have to select CD Catalog item in content tree.
- I have to make sure that HOME ribbon is selected. Click on Delete subitems button available in Operations chunk.
- Login into Sitecore Client and select Core database.
- Navigate to /sitecore/content/Applications/Content Editor/Context Menues/Default/Delete.
- You will find item:delete(id=$Target) in Message field. Clear the content of Message field.
- Create a new child item under /sitecore/content/Applications/Content Editor/Context Menues/Default/Delete node using template /sitecore/templates/System/Menus/Menu item. Set item name as Delete.
- Enter item:delete(id=$Target) in Message field and set Display name as Delete. Also set Icon field.
- Create a new child item under /sitecore/content/Applications/Content Editor/Context Menues/Default/Delete node using template /sitecore/templates/System/Menus/Menu item. Set item name as Delete Subitems.
- Enter item:deletechildren(id=$Target) in Message field and set Display name as Delete Subitems. Also set Icon field.
- Navigate to Master database and right click on CD Catalog item. You will notice Delete Subitems action is available in Sitecore context menu.
0 comments :
Post a Comment