How to display detailed ratings on list pages

From JReviews Documentation
Revision as of 00:01, 4 January 2010 by Jreviews (Talk | contribs) (Created page with 'It is possible to display detailed ratings on list pages (blogview, tableview, thumbview), but detailed ratings take a lot of space so you will need to modify the layout. I wil…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

It is possible to display detailed ratings on list pages (blogview, tableview, thumbview), but detailed ratings take a lot of space so you will need to modify the layout.


I will show you how to add detailed ratings on a tableview list page because it has more room then other views.


This is how the ratings look by default on tableview page:

ListRatings1.png


We will modify the code to display detailed ratings like on listing detail page.

Open this theme file:

  • \com_jreviews\jreviews\views\themes\{theme_name}\listings\listings_tableview.thtml


Find the code that starts with <!-- BEGIN RATINGS COLUMN -->

Replace it with this:

<!-- BEGIN RATINGS COLUMN -->
<td class="columnLast">
	<?php echo $this->element('detailed_ratings',array('review'=>$listing,'reviewType'=>'user'));?>
</td>
<!-- END RATINGS COLUMN -->


Now the detailed ratings are displayed like this:

ListRatings2.png


To display editor detailed ratings use this code:

<?php echo $this->element('detailed_ratings',array('review'=>$listing,'reviewType'=>'editor'));?>


Customizing the layout of detailed ratings for the list page

The code that generates the layout for detailed ratings is in:

  • \com_jreviews\jreviews\views\themes\default\elements\detailed_ratings.thtml


That file is used to display detailed ratings on the listing detail page, so if you want to modify the layout only for detailed ratings on list pages, copy that file and rename it to:

  • \com_jreviews\jreviews\views\themes\default\elements\detailed_ratings_list.thtml


To call that file in listings_tableview.thtml file use this code:

<?php echo $this->element('detailed_ratings_list',array('review'=>$listing,'reviewType'=>'user'));?>