How to publish to delete items in Sitecore

Stelio made a post on how to handle the deletion of items across Sitecore databases. And I remembered that I wrote code for this situation in another way.

The way that I’ve approached this is to extend the Item Delete event so I can publish deleted item by publishing the parent item.

Basically, I detect the parent of the item that is currently deleted by an editor, and I publish that parent item on each target database that we have on our Sitecore installation.

The code, with comments for this here:

And the config changes needed:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.