Making the content editors' lives as easy as possible should be a key priority on any project. Previously, when I have worked with large organizations, it is very difficult content publishing wise, to know who has published what. In general, I have always recommended not doing a sitewide smart-publish, but the content editor should only publish the items they are working on.

A scenario I've seen time and time again, is people want to publish a page made of many sub-items but they can't remember what has been published and what hasn't. Out of the box, Sitecore doesn't provide this functionality, but with some custom development, we can add it in pretty easily.

In today's tutorial, I'm going to show you how to create a custom gutter item in order to achieve this. If you are new to Sitecore gutters, then I would recommend that you read, The Sitecore Gutter Explained

The Code

First up, I'll cover the code to render the published status next to an unpublished item.

This code might look a bit long, but it's pretty simple. To make a custom Gutter, you will need to inherit from 'GutterRenderer'. We override GetIconDescriptor() and in here add the custom logic. First, we get all the publishing targets on the website:

Next, we check if the item has been published to the publishing database. In the majority of cases, this will just be 'web. I've added an extra check in case you have more. If the item is only published in one of the publishing environments, then a yellow dot will be applied to the item, with the tooltip 'Not Published On All Targets'. As the code iterates through the publishing targets, if the item is found then it has been published and the PublishedState is set appropriately.

If the item is published,the code returns null and nothing needs to be rendered. If the item isn't published, a 'GutterIconDescriptor' item is returned with the appropriate message. One thing to note is the 'Click = string.Format("item:publish(id={0})", item.ID)'. If you click on the red dot in the content editor, the published dialog for that item will open.

Enabling the Publication Status Gutter

Go to the Sitecore Desktop and make sure the website is using the 'Core' database (see How To Switch Between The Core and Master Database in Sitecore):


Now, we are logged into the 'Core' database, open up the content editor


We will need to create a new 'Gutter' object that points to the custom class we have created. Navigate to:

/sitecore/templates/Sitecore Client/Content editor/Gutters/


To create a new gutter you just need to set two properties. I usually do a duplicate of an existing one, call it 'Publish Status'. In the items properties, set the 'Header' to the value you want to appear in the Gutter Context menu and the type. This is the namespace and class name of the class that contains the custom gutter code. Note, you do not need to add the assembly name. Save the item. Now if you go back to the Sitecore desktop and switch the database back to 'master'. You should see your custom gutter item in the gutter context menu (right click on the left grey toolbar).


If you enable 'Publication Status' you will now see a red dot against any unpublished item and a yellow dot against semi-published items. If you click on the dot you should see the items published dialogue.



In today's post I've covered how to add the published status next to an item in the Sitecore editor. Adding this functionality involves some custom code as it is not supported out of the box. To add in the custom functionality, we create a custom gutter item. In the 'Core' database we add the custom gutter via the editor, after that it's a simple matter of enabling it in the editor.