Hi!
I'm struggling with poll style. I have put a "Most recent poll" block on my front page, and I have noticed that Drupal adds a colon after the poll title (not the block title). Anybody knows how to remove that little colon? I have a question as a title and don't want a colon after the question. I have searched in poll.module but haven't found this command.
Thanks

Comments

macat’s picture

Hi!

I have this problem also. I found in the code (in poll_view_voting function):

[...]'#title' => $block ? check_plain($node->title) : ''[..]

So.. the form API generate the colon. I don't have simple idea to the problem....

_dynamic’s picture

I found exactly that line but when I changed it I got an error message. Will try again...

macat’s picture

2 way, that I prefer:

  • Wrong way, but simple: Translate this text: '!title: !required'
  • Override the theme_form_element function in your theme.
    Overwrite this line:
    $output .= ' <label for="'. $element['#id'] .'">'. t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) ."</label>\n";
    

    (You can analyse by the form id, which label do you want.)

jazzitup’s picture

I didn't want to hack Form API, so I just made a minor replacement in the poll module.
Go to "poll.module" and locate the function called "theme_poll_view_voting".

Replace the line 392:
$output .= drupal_render($form['choice']);

... with the line:
$output .= str_replace('?:', '?', drupal_render($form['choice']));

--
madjoe

_dynamic’s picture

Great,
that worked! Can you explain what these lines do? Exactly where is the colon created the first time?