Skip navigation
Help

poll-bar.tpl.php

  1. drupal
    1. 6 drupal/modules/poll/poll-bar.tpl.php
    2. 7 drupal/modules/poll/poll-bar.tpl.php

Default theme implementation to display the bar for a single choice in a poll.

Variables available:

  • $title: The title of the poll.
  • $votes: The number of votes for this choice
  • $total_votes: The number of votes for this choice
  • $percentage: The percentage of votes for this choice.
  • $vote: The choice number of the current user's vote.
  • $voted: Set to TRUE if the user voted for this choice.

See also

template_preprocess_poll_bar()

1 theme call to poll-bar.tpl.php

File

drupal/modules/poll/poll-bar.tpl.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Default theme implementation to display the bar for a single choice in a
  5. * poll.
  6. *
  7. * Variables available:
  8. * - $title: The title of the poll.
  9. * - $votes: The number of votes for this choice
  10. * - $total_votes: The number of votes for this choice
  11. * - $percentage: The percentage of votes for this choice.
  12. * - $vote: The choice number of the current user's vote.
  13. * - $voted: Set to TRUE if the user voted for this choice.
  14. *
  15. * @see template_preprocess_poll_bar()
  16. */
  17. ?>
  18. <div class="text"><?php print $title; ?></div>
  19. <div class="bar">
  20. <div style="width: <?php print $percentage; ?>%;" class="foreground"></div>
  21. </div>
  22. <div class="percent">
  23. <?php print $percentage; ?>% (<?php print format_plural($votes, '1 vote', '@count votes'); ?>)
  24. </div>