Creating a gutter to show unpublished items

In the Content Editor, the left margin of the content tree is known as gutter. This area contains icons that can be used to display the status or type of the corresponding item and icons can be toggled on or off.

Let's create a custom gutter icon to identify unpublished items so that we will be able to know the publishing status of all expanded items very easily.

How to do it…

  1. In the SitecoreCookbook project, create a PublishGutter class in the Gutters folder, and inherit it from the Sitecore.Shell.Applications.ContentEditor.Gutters.GutterRenderer class.
  2. Add enum PublishStatus to show the publishing status as follows:
    enum PublishStatus
    {
      Published, NeverPublished, Modified
    }
  3. Add the CheckPublishStatus()

Get Sitecore Cookbook for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.