Posted by everkuil on September 14, 2012 at 9:10am
3 followers
Jump to:
| Project: | CAPTCHA |
| Version: | 7.x-1.0-beta2 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
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
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| captcha.png | 22.05 KB | Ignored: Check issue status. | None | None |
Comments
#1
Hi, Erik.
In your theme template.php add new preprocess function.
<?phpfunction 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.
#2
Dear Alexander,
Your answer did the tric, thanks a lot.
Erik
#3