home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (poll-bar--block.tpl.php)

This example Drupal source code file (poll-bar--block.tpl.php) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

bar, class, div, percent, php

The poll-bar--block.tpl.php Drupal example source code

// $Id: poll-bar--block.tpl.php,v 1.1 2010/01/13 06:07:27 webchick Exp $

 * @file
 * 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 template_preprocess_poll_bar()

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

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal poll-bar--block.tpl.php source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.