I would like to show a message in the new (and improved) Tridion 2013 MessageCenter.
In Tridion 2011 I used the following code:
$messages.registerNotification(data);
However, this does not work in Tridion 2013.
Any ideas?
Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI would like to show a message in the new (and improved) Tridion 2013 MessageCenter.
In Tridion 2011 I used the following code:
$messages.registerNotification(data);
However, this does not work in Tridion 2013.
Any ideas?
You can try this.
var msg = $messages.createMessage(Tridion.MessageCenter.Implementation.Notification, "Text", "Title", false/true, false/true);
$messages.registerMessage(msg);
I haven't seen any changes with regards to the $messages
API between 2011 and 2013, the following calls all work fine on 2011 and 2013 for me:
$messages.registerNotification("custom notification message");
$messages.registerError("custom error message", null, null, null, true);
$messages.registerWarning("custom warning message", null, null, true);
Even using the predefined messages from the resource bundle still work for me:
$messages.registerNotification($localization.getEditorResource("PublishPopupSentToPublishQueue", "tcm:0-0-0");
So I'm expecting something else is wrong, maybe your data
object is not defined?
You may also want to explore the SignalR and Message Center integration.
A step by step process has been explained very nicely by Robert and Will on SDL Tridion World site.
You may refer the link below for details:
http://sdltridionworld.com/articles/sdltridion2011/signalr_messagecenter.aspx