I want to show some custom Error Messages as Notifications right under the toolbar in the experience editor. I've tried to implement the Alerts from Habitat but I am not shure if this is the right thing I need and I don't get it working in my local solution.
So I am trying the PageEditorNotifications, I think this could be a solution for my problem to get a message like
but I am not able to patch the proccessor in the right place
I need it in here:
but my Patchfile tries are not working. I've tried the following Patch files:
V1
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore role:require="Standalone or ContentManagement">
<group groupName="ExperienceEditor" name="ExperienceEditor">
<pipelines>
<getPageEditorNotifications>
<processor type="Foundation.ExperienceEditor.Pipelines.ShowCustomNotifications, Foundation.ExperienceEditor" patch:after="processor[@type='Sitecore.ContentTesting.Pipelines.GetPageEditorNotifications.GetContentTestingNotifications, Sitecore.ContentTesting']" />
</getPageEditorNotifications>
</pipelines>
</group>
</sitecore>
</configuration>
V2
<configuration xmlns:patch="sitecore.net/xmlconfig" xmlns:set="sitecore.net/xmlconfig/set">
<sitecore>
<pipelines>
<getPageEditorNotifications>
<processor type="Foundation.ExperienceEditor.Pipelines.ShowCustomNotifications, Foundation.ExperienceEditor" />
</getPageEditorNotifications>
</pipelines>
</sitecore>
</configuration>
V3
<configuration xmlns:patch="sitecore.net/xmlconfig" xmlns:set="sitecore.net/xmlconfig/set">
<sitecore>
<getPageEditorNotifications>
<processor type="Foundation.ExperienceEditor.Pipelines.ShowCustomNotifications, Foundation.ExperienceEditor" />
</getPageEditorNotifications>
</sitecore>
</configuration>
but non of them is patching the right location :-/ so that the processor get called. I am using Sitecore 9 update 2
processor code:
namespace Foundation.ExperienceEditor.Pipelines
{
public class ShowCustomNotifications : GetPageEditorNotificationsProcessor
{
public override void Process(GetPageEditorNotificationsArgs arguments)
{
arguments.Notifications.Add(new PageEditorNotification("Hallo Welt", PageEditorNotificationType.Error));
}
}
}