Content events


Steps

Description

Remark

Setup environment

Create a plug-in project using the VS.NET extension template. Give it a name.

Content event will be triggered when content added, updated or deleted.

Find the sample code under “/extensions/contentevent”, uncomment the code file and move it the file location you want.

Development

Implement ISubscriber

Receive: Receive the event notification and execute your business code

 

ContentActions
Add: After the content has been added
PreAdd: Before the content is added
Update: After the content has been updated
PreUpdate: Before the content is updated
Delete: After a content has been deleted
PreDelete: Before a content is deleted

 

Add an attribute to register your class in IOC

[Kooboo.CMS.Common.Runtime.Dependency

.Dependency(typeof(ISubscriber), Key = "MyEvent")]

 

 

Debug

You can directly develop and debug your content event code within the VS.NET

 

Deployment

Build your project, get the generated dll.
Place the dll into the Kooboo instance that you want to use the event. It will be working directly