Developer forum

Forum » Development » Custom validation on BasicForum create thread

Custom validation on BasicForum create thread

Emil Ryberg
Reply

Hello

Is it possible to override a method in the DynamicWeb API to create or extend the validation that happens when an user creates a post or thread in the BasicForum module (DW 8)?

 


Replies

 
Nicolai Pedersen
Reply

Hi Emil

The best option must be to use the Dynamicweb.Modules.Forum.Notifications.Frontend.BeforeContent notification. In that notification subscriber, see if the QueryString("cmd") = "createPost" - if so, test if the posted data is as it should be. If it is not, set the StopExecution property to True on the BeforeContentArgs that was passed to your notification subscriber. You can then add an error message to the Output property also on the BeforeContentArgs object to return the frontend.

BR Nicolai

 

 

You must be logged in to post in the forum