I have some forms created with the Drupal 7 core poll-module.
On these forms the captcha placement is beneath the vote button instead of above, see picture.

I hope you can help me to fix this.

Erik

Files: 
CommentFileSizeAuthor
captcha.png22.05 KBeverkuil

Comments

Status:Active» Needs review

Hi, Erik.

In your theme template.php add new preprocess function.

<?php
function THEME_NAME_preprocess_poll_vote(&$variables) {
 
$form = $variables['form'];
 
$variables['choice'] = drupal_render($form['choice']);
 
$variables['title'] = check_plain($form['#node']->title);
 
$variables['vote'] = drupal_render($form['captcha']);
 
$variables['vote'] .= drupal_render($form['vote']);
 
$variables['rest'] = drupal_render_children($form);
 
$variables['block'] = $form['#block'];
  if (
$variables['block']) {
   
$variables['theme_hook_suggestions'][] = 'poll_vote__block';
  }
}
?>

Because poll module, render all children after submit button.

Dear Alexander,

Your answer did the tric, thanks a lot.

Erik

Category:bug» support
Status:Needs review» Active