Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Hi
I haven't tested this myself but there two static events on ContentTypeRepository (ContentTypeSaved and ContentTypeDeleted), that I think you should be able to use to handle this scenario.
Regards
Per Gunsarfs
Hi,
Thanks for your reply. Can confirm the below logic works.
protected void Application_Start() { ContentTypeRepository.ContentTypeSaved += (sender,eventArgs) => { // Logic here }; }
Hey Luke,
Just a small side-note. You should rather use an initialization module to subscribe to events. Read more https://world.episerver.com/documentation/developer-guides/CMS/initialization/
They will get re-executed in case of an exception + you can add dependencies. A very similar example to yours: https://world.episerver.com/documentation/developer-guides/CMS/initialization/Creating-an-initialization-module/
BR,
Marija
Hi,
I'd like to implement some additional CMS auditing to record when any changes are made to a page type by a user within the CMS (Such as adding a new property, or removing an existing property).
I was hoping that there would be an event or something similar that I can hook into but am having trouble identifying anything suitable.
Has anyone accomplished a similar thing?
Thanks.