Locking and unlocking is another useful feature from Sitecore and comes handy when we are working with numerous pages. Whenever we edit an item, always need to lock that particular item to prevent other users editing the same item which would result one of the user’s changes being unsaved. When we have finished editing an item we should ensure that the item is unlocked so it’s available to other users again. However an Admin has all the rights to edit other user’s locked items.
Lock an item
We can lock the item manually as below:
Login to Sitecore and navigate to item which needs to be edited. In the ribbon, click the Home tab and and Edit button or ‘Lock and Edit’ just above the quick info.
On the left content tree we can get the info of the items locked by us by right clicking the Quick Action bar. On right clicking the Quick Action Bar, a floating menu appears which lists My Locked items as one of the option which appears next to the items that we have locked and on clicking on that icon you can directly unlock the item from there. Locked items displays the items that are locked by other users along with your locked items and on mouse hover the icon, it displays the name of the user who has locked that particular item.
Unlocking an item
To unlock an item, on the Review tab in the ribbon click on ‘Check In’ or in the Quick Action bar on the left of the content tree.
Click on your locked item icon appears next to the locked item, clicking on this icon will unlock the item.
In case, we have worked on multiple pages so instead of clicking each of the page to unlock, we can easily unlock all the items at the same time by going to the Review tab on the Ribbon and then click on My Items. My Items too has the option of unlocking all the items at one go (Unlock all) or select one more items and then click Unlock. Also this option in Sitecore keeps a track of pages we have worked.
Deleting an Item:
We need to delete items and in Sitecore one can delete items with its sub-items or all its version or the single version of a particular item.
Whenever we need to delete an item with sub-items, on the Home tab in the Operation group click Delete or navigate to that particular item on the Content Tree and right click on it then we are prompted with pop up message as below.
When we click on ‘OK’, it would delete all child items under the parent test item ‘About-us-Sorting Test’.
Also if there still exists links to the items which we need to delete, it would result in broken links on the website. For example, suppose I try to delete a page as per below screen-grab which may linked elsewhere on the website, then the following Breaking Links dialog box opens as follows:
In the above Breaking Links dialog, we have three options:
- Remove links: it removes all the links that exists to this page
- Link to another item: change all the links which links to this page to link to another item.
- Leave links: currently leave the links in broken links report then we could redirect them to any other link.
In the above scenario, I have created and linked TestPage2 just to one of page on the website and while deleting the TestPage2, get the above dialog box, now on selecting the first option Remove Links, it will give the below dialog box which states that the TestPage2 has just a single link to it. Clicking on continue will remove the link on page it was linked and proceed with deleting of the item.
Link to another item:
Clicking on Link to Other Item will give an option to re-link to other item as below:
On changing the link it will give the below pop up message and this will allow me to delete the TestPage2 now.
Choosing the last option i.e. Leave links will give the below dialog box which would list the number links to this particular item (number of links to TestPage2). Clicking on ‘Continue’ will allow me to delete the item but then it would result in broken links on the site.
At times we may accidentally delete an item. To avoid this Sitecore has a feature called Recycle Bin which is used to restore a deleted item or delete the items permanently. To open Recycle bin navigate to the sitecore menu as below.
Restore an item from Recycle Bin:
To restore an item from the recycle bin open the item and select the item which needs to be restored.
Click on the ‘Restore’ button in the ribbon and Sitecore would open the following dialog box to confirm whether we would like to restore the item. Click on ‘OK’ to restore the item.
Permanently delete an item:
To permanently delete an item from Sitecore, open the recycle bin and select the item to be removed.
Click the ‘Delete’ button in the ribbon as highlighted above then Sitecore would open a dialog to confirm that we would permanently delete the item.
Clicking on ‘Ok’ will permanently delete the item.