Tag Archives: processor

Publish Related Items & Defining Custom Relationships via Code – Sitecore

related items

Version v7.2 Released

First and foremost, I’d like to congratulate the Sitecore Dev team on the new v7.2 release. I’ve been using Sitecore since v6.1 and since then, have developed a modest wish list of features I would have loved to see. I can honestly say, this version is jam-packed with features from that list.

Publish Related Items Feature – Explained

One of those new awesome features is the Publish Related Items feature. What. A. Timesaver.
Publish Related Items
It’s especially great for rapid development and deployment. Imagine you are developing a new feature.

  • You create the template.
  • You create the layouts.
  • You upload the media.
  • You create the content based on the templates, with the mapped layouts in the presentation layer and associate any media in the image files

You want to publish? Before v7.2, you had to publish each one individually. Not that rapidly deployed. Now, with Publish Related Items checked, all those assets associated with the content item you are publishing will get published, including any and all images contained within the content item, layouts, and templates.

Continue reading

Using Sitecore Publishing Pipeline to Refresh External CDN Cache

This is either one of those things you may never have to use, or you come across a requirement and realize this is exactly what you need and just didn’t know what it was called.  I fell into the latter category when I needed to programmatically refresh images in my media library that were cached in my company’s content delivery syndicator – Akamai.   Thankfully, @AlexShyba pointed me in the right direction.

Clear external image/CDN cache when a media item gets published.


The PublishProcessor object is located in the Sitecore.Publishing.Pipelines.Publish namespace. We will need to inherit from this object to your own class and override the Process(PublishContext) method with our own custom functionality.

The PublishContext that’s passed in by Sitecore’s publishing processor has a list of items being published.  All we have to do is iterate through the list and use the Sitecore Item’s Path.IsMediaItem property to determine if it’s a media library item or not.  If it is, we just pass it or its full path to a custom method and use whatever API is provided by your CDN of choice to force refresh on it.

Continue reading