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…
- In the
SitecoreCookbook
project, create aPublishGutter
class in theGutters
folder, and inherit it from theSitecore.Shell.Applications.ContentEditor.Gutters.GutterRenderer
class. - Add
enum PublishStatus
to show the publishing status as follows:enum PublishStatus { Published, NeverPublished, Modified }
- 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.