Skip to content

Instantly share code, notes, and snippets.

@gyusza
Last active June 13, 2017 09:48
Show Gist options
  • Save gyusza/bf3aa9ec4ffc32cb444710d0a22a3814 to your computer and use it in GitHub Desktop.
Save gyusza/bf3aa9ec4ffc32cb444710d0a22a3814 to your computer and use it in GitHub Desktop.
Gutter Example Powershell
<#
.NAME
Item Has 20 Or More Sub-items Gutter
.SYNOPSIS
Renders gutters indicated whether the item has more than 20 sub-items.
.NOTES
Mike Reynolds
#>
$item = Get-Item .
$gutter = New-Object Sitecore.Shell.Applications.ContentEditor.Gutters.GutterIconDescriptor
if($item.Children.Count -gt 20) {
$gutter.Icon = "Applications/16x16/delete.png"
$gutter.Tooltip = "This Item has more than 20 sub-items!"
} else {
$gutter.Icon = "Applications/16x16/check2.png"
$gutter.Tooltip = "This Item has 20 or less sub-items."
}
$gutter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment