Multiple Recaptcha

Time has come to contribute back to the Drupal community

Our very first Drupal 8 contributed module, multiple recaptcha

In the last 5 years we've been building Drupal websites for our clients and we have always downloaded modules, used them, but never thought about how much time someone else has invested into creating them.

We've learned this lesson when one of our websites had 2 forms on one page and we had a requirement that every form should have a captcha. Unfortunately, there were no contributed modules and we had to build it from scratch.

The task is not that hard, we could have simply hack the already there recaptcha module, but that wouldn't have been the right solution.

What is the right way to build a contributed module that depends on other drupal modules?

Hooks, the Drupal hook system came to the rescue and the fact that the other contributors have been coding their modules the right way.

We just used the hook called hook_recaptcha_captcha and made the appropriate settings to display on the front end the html markup and the javascript code we need for our situation.

If you're interested in seeing the code, here's a link to the project.