Pages

17 August, 2022

Enable Sitecore Content Authors to move bulk items in Content and Media Library - PowerShell

Before Sitecore PowerShell, I created a Sitecore Marketplace (retired) module - SmartTools CopyMove (https://github.com/nehemiahj/SmartTools.CopyMove) which enabled content authors to copy parent item without sub items to a new folder and move/copy child items without the parent item. 

With Sitecore PowerShell in place, many of these module can be easily implemented. Thanks to Adam Najmanowicz and Michael West and the many contributors. 

This script will enable the content authors to take care of moving a bunch of items from one or multiple folders to a destination folder. When this script is executed, Content author will be provided with a dialog to choose the items and the destination folder and on click of the move button, items will be moved. 



In order for content author to start the process, we can add a content editor button in Home ribbon and Operations chunk. In the PowerShell system modules folder, PowerShell Script Library can be created with the move script. Here we can add the rules to determine whether this button is available for all the content authors or only to the users belong to a Role. 

Content Editor --> Ribbon --> Home tab --> Operations chunk --> Bulk Move button

../Modules/PowerShell/Script Library/SPE/Scripts/Content Editor/Ribbon/Home/Operations/Bulk Move.


When content author click the button, there will be an option to select Content and Media library items and a field for selecting the destination folder. 
  • You can move either Content or Media item at a time.
  • If the Items to move contains a parent of the Destination folder, then there will be an error. (You cannot move a parent item to a child item)
  • Content can be moved to another content folder.
  • Media item can be moved to another media library folder or media item.
  • If there is a selection of both content and media item, there will be error to let user to select correct items.
  • If the items to be moved are not selected or destination folder is not selected, there will be a validation error.
  • Destination folder can be either content or media folder. 
  • Limitation: Destination Folder is not restricted to only Content and Media folder at this time. Entire tree will be available. If the content author chooses other than content and media folder, there will be a validation error. 
>>> Planning to enhance this in a couple of months





No comments:

Post a Comment

blockquote { margin: 0; } blockquote p { padding: 15px; background: #eee; border-radius: 5px; } blockquote p::before { content: '\201C'; } blockquote p::after { content: '\201D'; }