Sitecore Preview Notifications

Within page editor you can setup custom info bars to feedback more info to your users using page editor notifications. An example of this is:
notification

Custom notifications can be patched into the app via:

Where your custom code implements:

In this example, I based my implementation on Sitecore.Pipelines.GetPageEditorNotifications.GetWorkflowNotification, Sitecore.Kernel

In order to get notifications showing in preview you need to customize things slightly. The toolbar shown in preview and page editor is the WebEditRibbonForm. This is linked into the ui via:
/sitecore/shell/applications/webedit/webeditribbon.aspx
The line that ties the class and the aspx together is:

Using reflector I extracted out the existing implementation of WebEditRibbonForm and extended to work with preview:

An interesting challenge is the need to use reflection to call private static methods on the base class:

The only thing you now need to do is patch in your own custom pipeline:

One thought on “Sitecore Preview Notifications

Leave a Reply

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