0

I am using rate module to count likes and dislikes. Here I am using Thumbs up / down widget. My question is that how can I show a button below thumbs up and dislike button below thumbs down.

In the image given below there is text "Total likes". Here I would like to place a button and this button should provide same functionality that thumbs up is providing.

enter image description here

0

i found answer of my question. find rate-template-thumbs-up-down.tpl.php file in rate -> templates -> rate-template-thumbs-up-down.tpl.php

copy this file and place in bartik/templates or your_theme/templates folder.

then override this file by below code:

<?php

/**
 * @file
 * Rate widget theme
 */
 ?>

 <?php
 /*
 <div class="rate-label">
 <?php print $display_options['title']; ?>
 </div>
 */
 ?>
 <div class="like-container">
 <div class="likes">
 <span>
 <img src="<?php print base_path() . drupal_get_path('theme', 'bartik'); ?      
 >/images/likes.png"></span>
 <span><?php print $results['up']; ?></span>
 <span> total likes</span>
 </div>
 <button class="likes-button"><?php
 print theme('rate_button', array(
  'text' => t('Likes'),
  'href' => $links[0]['href'],
  'class' => "likes-button-link")
 );

 ?></button>
 </div>

 <div class="dislike-container">
 <div class="dislikes">
 <span>
 <img src="<?php print base_path() . drupal_get_path('theme', 'bartik'); ? 
 >/images/dislikes.png">
 </span>
 <span><?php print $results['down']; ?></span>
 <span> total dislikes</span>
 </div>
 <button><?php
 print theme('rate_button', array(
  'text' => t('Dislikes'),
  'href' => $links[1]['href'],
  'class' => "dislikes-button-link")
 );
 ?></button>
 </div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.