I would like for poll results to ONLY list the PERCENTAGE results. I do not want to display the number of votes that each choice got, and I do not want to display the total number of votes on the poll. How do I do this?

Typically, the Poll results will read as follows:
(Option A) - 22% (7 votes)
....
Total votes: 58

I want only the 22% part and nothing else!

Thank you SO MUCH in advance!!! :)

Comments

vm’s picture

check the module file for a theme function and if there investigate how to override theme functions to remove or add elements.

blackarma’s picture

You can create 2 tpl.php files for this also.

poll-bar.tpl.php

<div class="text"><?php print $title; ?></div>
<div class="bar">
  <div style="width: <?php print $percentage; ?>%;" class="foreground"></div>
</div>
<div class="percent">
  <?php print $percentage; ?>%
</div>

and

poll-results.tpl.php

<div class="poll">
  <?php print $results; ?>
	<?php if (!empty($cancel_form)): ?>
    <?php print $cancel_form; ?>
  <?php endif; ?>
</div>
gbilski’s picture

Thank you, worked a treat.

play4quarters’s picture

Super helpful!!!

anniewang’s picture

hi, thanks for the tip, but could you elaborate more? i'm new to drupal and i don't know how to do any of this. how should i set up that new code?

thanks!

vm’s picture

create the two files mentioned
add the code given to each file

put them in your theme folder

clear your theme registry/cache tables

test

anniewang’s picture

thank you guys so much. it worked!! :)

Yuki’s picture

subscribe

mkaiser-1’s picture

I don't have access to module themes or templates. Also, there isn't a configuration option for the Poll module. Any way I can remove vote number and total votes without modifying the template files?

Thanks in advance!