How do I attach a CAPTCHA when adding the contact form to a node? I am embedding the Drupal contact page in a node. I added the following code in template.php.

function sakura_preprocess_node(&amp;$variables) {
  $node  = $variables['node'];
  if (!empty($node)) {
    $variables['template_files'][] = "node-" . $node-&gt;nid;
  }
}


Then, I created the node-24.tpl.php template file (for the node where I add the contact form).

require_once drupal_get_path('module', 'contact') .'/contact.pages.inc';

//no need to maintain two version of node.tpl.php
include "node-page.tpl.php";

function local_contact_page() {
  $form = contact_mail_page();
  // override default values here if you want
  // next one will select a different category
  //$form['cid']['#default_value'] = 0;
  $form['submit']['#value'] = 'Отправить';
  unset($form['copy'], $form['subject']);
  dpm($form);
  return($form);
}

function local_contact_page_submit($form_id, $form_values) {
  return(contact_mail_page_submit($form_id, $form_values));
}

function local_contact_page_validate($form, $form_state) {
  return(contact_mail_page_validate($form, $form_state));
}

print drupal_get_form('local_contact_page');

drupal_set_message($form_id);


I also enabled the CAPTCHA module with the math method. On /contact it shows the CAPTCHA, but it doesn't show it on the contact form I embebbed in the node.

How can I make the CAPTCHA appear on the node page with the contact form?
Webform module is best for creating forms and still having options that come with regular nodes. It also integrates with captcha.

What is the reason you are embedding the form in the node like that?