4

I have a custom form within CTools form wizard that I would like to use Mollom on. Is there an API function I can use to place it in the Form API on that page?

1 Answer 1

6

I'd suggest you simply integrate with mollom to expose your form.

You just need to implement two simple hooks and you can also configure if it should be CAPTCHA only or analyse some fields.

Hook documentation:

As an example implementation, you can have a look at my patch against Privatemsg: http://drupal.org/node/720038#comment-3501758 or have a look at these: http://drupalcontrib.org/api/search/7/_mollom_form_.

3
  • Yes it does, the API for 6.x and 7.x is identical. I just used the 7.x links because they are what you get by default now.
    – Berdir
    Commented Mar 3, 2011 at 19:27
  • Okay, now I have Mollom attached to my form, but it is coming after my Submit button. I can't see it in the form array. Is this a limitation of the form wizard with CTools?
    – Kevin
    Commented Mar 3, 2011 at 19:40
  • Never used Ctools form wizard yet. Mollom adds it's form elements in hook_form_alter() so it comes last by default unless you specify a weight. If you can, you should add a hight weight to your submit buttons. You could move your buttons inside a "$form['actions'] = array('#type' => 'actions');" element, which has a weight of 100 by default. This is what is used in the node forms for example
    – Berdir
    Commented Mar 3, 2011 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.