DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Need Event to handle when ever ContentItem is updated

 2 Replies
 1 Subscribed to this topic
 30 Subscribed to this forum
Sort:
Author
Messages
New Around Here
Posts: 19
New Around Here
New Poster
New Poster
Congrats on posting!

Hello Team,

I need an event to handle when ever any content item is updated, so that I can run some business logic to validate and read the content. Is there any way to do so in DNN?

I tried to capture them using ModuleUpdated event, but this event is not triggred when content of module is updated. Here we are looking for the modules like "HtmlModule" in which we can add any html content. Please suggest me if there is any such way or code example where we have done something similar.

In my analysis so far I have found-

In EventLog we have many events like MODULE_UPDATED, MODULE_CREATED, TAB_MODULE_UPDATED, FILE_CREATED, etc... For few of them we can associate event handlers Like Module Events, File Events. So there we can intercept them in our code persomer some additional business logic as required. But for few like Tab Modules events we do not have any way to associate event handlers. Also for few cases like when ContentItem is updated I do not see any event log or event handler.

Regards,

Alok

Advanced Member
Posts: 208
Advanced Member
Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
MVP
MVP
You're an MVP!
New Poster
New Poster
Congrats on posting!
I have never tried to trigger module events directly from DNN, so I don't know if it has this build into the core. We have always used modules that have event interfaces.

RocketCDS can do this: https://www.rocket-cds.org/

https://github.com/Rocket...es/EventInterface.cs

The event triggers on every before and after API command. But if you already have the website build, this will not help you unless you rebuild.
Senior Member
Posts: 1607
Senior Member
MVP
MVP
You're an MVP!
New Poster
New Poster
Congrats on posting!

There isn't an event for this that I'm aware of.  The obvious thing to try is a database trigger, but those can be tricky to maintain longer term for numerous reasons.  

Instead, I'd suggest considering having a well-planned Scheduled Job to do this for you.  

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved