In Sitecore development, content editors often need quick visibility into the publication status of items. While Sitecore provides built-in publishing tools, a visual indicator directly in the Content Editor can significantly improve workflow efficiency. In this guide, I’ll show you how to create a custom gutter that displays real-time publication status with version checking.

publish status gutter

Prerequisites

  • Sitecore instance (version 9.x or later)
  • Sitecore PowerShell Extensions (SPE) installed
  • Content Editor access

Step 1: Understanding Sitecore Gutters

Sitecore gutters are visual indicators in the left pane of the Content Editor that provide quick insights about items. They can display icons with tooltips based on custom business logic.

gutters

Step 2: Creating the Gutter Script Item

2.1 Navigate to the Gutters Directory

Open the Content Editor, make sure you are in the master database, and navigate to:

/sitecore/system/Modules/PowerShell/Script Library

2.2 Create a Powershell Script

Right click in Script Library, click Insert, click Powershell Script Module

ps script module

Set “Publish Module”

ps script module name

Click the Publish Module and Check “Enabled”, then click Save

enable module

Right click in Publish Module, click Insert, click Powershell Script Library

ps script library

Set “Content Editor”

ps script library name

Right click in Content Editor, click Insert, click Powershell Script Library

ps script library 2

Set “Gutters”

gutter folder name

Right click in Gutters, click Insert, click Powershell Script

ps script

Set”Publish Status”

ps script name

2.3 Configure the Script Item

Select the Publish Status Script and click Elevate session. Log in to edit the item.

elevate session

Fill in the following fields:

  • Script Body: Paste the PowerShell code below
$masterItem = $SitecoreContextItem

# Skip execution if in core database
if ($masterItem.Database.Name -eq "core") { return }

# Check if item is in allowed paths
$itemPath = $masterItem.Paths.Path
if (-not $itemPath.StartsWith("/sitecore/content/", [System.StringComparison]::InvariantCultureIgnoreCase) -and 
    -not $itemPath.StartsWith("/sitecore/media library/", [System.StringComparison]::InvariantCultureIgnoreCase)) { 
    return 
}

# Get web database
$webDB = [Sitecore.Configuration.Factory]::GetDatabase("web")
if ($webDB -eq $null) { return }

# Get equivalent item in web database
$webItem = $webDB.GetItem($masterItem.ID, $masterItem.Language)
$published = $webItem -ne $null -and $webItem.Versions.Count -gt 0

# Create gutter icon descriptor
$gutter = New-Object Sitecore.Shell.Applications.ContentEditor.Gutters.GutterIconDescriptor

if ($published) {
    if ($webItem.Version.Number -eq $masterItem.Version.Number) {
        $gutter.Icon = "office/32x32/navigate_check.png"
        $gutter.Tooltip = "Published (latest version)"
    } else {
        $gutter.Icon = "apps/32x32/Warning.png"
        $gutter.Tooltip = "Published (v$($webItem.Version.Number)/$($masterItem.Version.Number))"
    }
} else {
    $gutter.Icon = "office/32x32/delete.png"
    $gutter.Tooltip = "Not published"
}

$gutter

Step 3: Script Logic Explanation

Database Context Filter
The script first checks if the current context is the core database and immediately exits if true. This prevents unnecessary processing since publication status only matters for content and media items, not system configuration elements.

Path Validation
It verifies whether the item resides within /sitecore/content/  or /sitecore/media library/ paths. This targeted approach ensures the gutter only appears for relevant content tree and media library items while ignoring system folders, templates, and layout items.

Publication Status Check
The script queries the web database to find an equivalent item using the same ID and language. Publication is confirmed through dual validation: item existence in the target database plus having at least one active version.

Version Comparison
For published items, the script performs version number comparison between web and master databases. This identifies whether the published content represents the latest version or requires updating, providing crucial version aware status information.

Icon Assignment
Based on the validation results, the script assigns appropriate icons and tooltips: blue check for current published items, version warning icon for outdated versions, and red X for unpublished content, delivering immediate visual feedback to content editors.

Icon assignment

Step 4: Enabling the Gutter

Open the PowerShell ISE

Click the Setttings Tab, expand Rebuild All, then click Sync Library with Content Editor Gutter

ps ise sync

This procedure will enable and make visible the Publish Status gutter in the left panel section.

Step 5: Testing the Implementation

Open the Content Editor, Right click in the left pane, and select “Publish Status

testing gutter

Hover the Icons to Test the tooltip

gutter tooltip

Conclusion

Implementing a custom publish status gutter provides content editors with immediate visual feedback about item status. This solution enhances productivity by reducing the need to switch between databases or use publishing reports.

The gutter is:

  • Customizable: Easily adaptable to specific needs
  • Non-intrusive: Only shows for relevant items
  • Informative: Provides version-level details

Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like