I want to display notification message like "Node already published, Now u can't published it " on umbraco cms ,before publish event , is it possible? how.....?
plz. give me quick reply, if possible.................
Yes, it is. I'm using similar functionality to prevent folks from publishing locked [by others] content in MyLocks. The magic starts at the ApplicationEventHandler.
public class ApplicationEventHandler : IApplicationEventHandler {
...
public void OnApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) {
// Tap into events that locking would affect PublishingStrategy.Publishing += (sender, e) => { if (e.CanCancel && MyLockStorage.HasLockedContent(e.PublishedEntities)) e.Cancel = true; };
However, now the big let down. You can't override the message when cancelling a publish event, you'll only get the "Cancelled by 3rd party..etc..etc..". If you can figure out how to intercept the message and put in your own, I would be keenly interested in it, but for the time being I don't believe what you are wanting to do is feasible with the current codebase without modifying the core or some hellacious hack.
Display notification message on umbraco cms
I want to display notification message like "Node already published, Now u can't published it " on umbraco cms ,before publish event , is it possible? how.....?
plz. give me quick reply, if possible.................
Yes, it is. I'm using similar functionality to prevent folks from publishing locked [by others] content in MyLocks. The magic starts at the ApplicationEventHandler.
However, now the big let down. You can't override the message when cancelling a publish event, you'll only get the "Cancelled by 3rd party..etc..etc..". If you can figure out how to intercept the message and put in your own, I would be keenly interested in it, but for the time being I don't believe what you are wanting to do is feasible with the current codebase without modifying the core or some hellacious hack.
is working on a reply...