I have written a class that extends ApplicationEventHandler in order to catch the publish event of certain document types.
I am struggling to find the documentation for V7.
I originally used Document.AfterPublish but noticed this is obsolete.
As such I used Umbraco.Core.Services.ContentService.Published += Content_Published;
I'm I correct to use this?
Also I placed the class in the App_Code folder, any other suggestions on where to place the class? (in terms of standards)
That looks right to me - here's the direct link to the documentation you are after.
App_Code is fine, particularly if you are working outside of Visual Studio. If you are using VS.Net though, I'd suggest looking at creating you code in a separate project that you reference from your web project. That way you can benefit more from compile time checking and intellisense.
Event Handler
I have written a class that extends ApplicationEventHandler in order to catch the publish event of certain document types.
I am struggling to find the documentation for V7. I originally used Document.AfterPublish but noticed this is obsolete. As such I used Umbraco.Core.Services.ContentService.Published += Content_Published; I'm I correct to use this?
Also I placed the class in the App_Code folder, any other suggestions on where to place the class? (in terms of standards)
Thank you as always!
That looks right to me - here's the direct link to the documentation you are after.
App_Code is fine, particularly if you are working outside of Visual Studio. If you are using VS.Net though, I'd suggest looking at creating you code in a separate project that you reference from your web project. That way you can benefit more from compile time checking and intellisense.
Andy
Thank you Andy, very much appreciated!
is working on a reply...