This project is read-only.

Comments Module: Display Captcha and Country Flag

Topics: Core, Customizing Orchard, General, Writing modules
Nov 1, 2011 at 11:38 PM


I have built a web site using Orchard 1.3 ( I had a problem with comment which was all comments being assumed as a SPAM if spam protection was enabled. To sort this out I added a CAPTCHA to the bottom of the comment part. 

To add the Captcha component I downloaded MvcReCaptcha from codeplex and modified it as it was built with ASP.NET 3.5 and also did not work smoothly with Orchard. I also had to make changes to Orchard.Comments module. I suggest that the development team include the Captcha facility in Orchard as a built-in feature.  If the source code of my modified module helps, I can send it to you.

Also I reckon that the comment part is so simple and plain. I am intended to make it look more fancy. One of the features that I am thinking of is displaying the cementer's flag besides their name. Does anyone have any idea how to do it, simply and with no headache in the context of Orchard?


Thanks heaps and keep up the great job

Nov 1, 2011 at 11:59 PM

Cool, Orchard is built from what people contribute, so yes, absolutely, that would be a nice one to add to the gallery. What changes did you have to make to comments?

To add any more stuff, I'm afraid you'd have to override the full comment template. Unfortunately the comment system is one of the most ancient parts of the system and it's in need of some refactoring (see, and maybe vote it up).

Nov 2, 2011 at 12:12 AM


I'm happy that you welcome it :-)

As I said I had to amend MvcReCaptcha to work with MVC 3 and Orchard. For example as it only is shown when the user is not logged in, the captcha control has to ignore the validation when it is not rendered in the view.

Then I modified the view (Comments.cshtml) to render Captcha text. In the action, I check the Captcha validation and display a Captcha error. 

How can I send you the modified module? I don't think it is a good idea to place it in the Gallery as it will conflict with the existing comment module. 

Nov 2, 2011 at 12:57 AM

Ideally, we would only add an extensibility point to the existing code. Why don't you send me what you have at bleroy at microsoft and I'll have a look?

Nov 2, 2011 at 1:37 AM

If comments where shapes, it should be as simple as registering a Captcha part on it