5-Star Rating Attribute - Half Stars?
Permalink
Is there a way to get the 1-5 Star Rating Attribute (for images, pages, etc) to support 1/2 star increments?
I'm working on a project where I'll be posting product reviews and each product will be rated in 4 different categories. I'd like each category to support 1/2 star ratings and then I can provide an overall rating that averages each of the 4.
Thanks!
I'm working on a project where I'll be posting product reviews and each product will be rated in 4 different categories. I'd like each category to support 1/2 star ratings and then I can provide an overall rating that averages each of the 4.
Thanks!
You'll generally have a better time getting add-on specific answers if you start a question from that add-on's page..
If you're talking about the reviews add-on, I imagine you can do that by changing the presentation template to average things differently. Would involve a little coding but not that hard.
If you're talking about the reviews add-on, I imagine you can do that by changing the presentation template to average things differently. Would involve a little coding but not that hard.
Not talking about the Review add-on. Just the built-in Ratings attribute that I can add to pages.
My idea is to add 4 ratings attributes to one of my page types to rate products based on 4 categories and then display an average rating based on the four attributes...but I'd like to be able to choose half star ratings and also output the average in half-star increments.
My idea is to add 4 ratings attributes to one of my page types to rate products based on 4 categories and then display an average rating based on the four attributes...but I'd like to be able to choose half star ratings and also output the average in half-star increments.
concrete5.4.2 should allow this.
Yea...I saw that in the documentation.
Any ideas on where to start?
Any ideas on where to start?
I know this is an old post but it might help someone...
To change ratings input for half stars you must edit the core rating helper here:
/concrete/core/helpers/rating.php and replace the html statements around line 80 with this:
To change ratings input for half stars you must edit the core rating helper here:
/concrete/core/helpers/rating.php and replace the html statements around line 80 with this:
$html = ''; $checked1 = ($value == 10) ? 'checked' : ''; $checked2 = ($value == 20) ? 'checked' : ''; $checked3 = ($value == 30) ? 'checked' : ''; $checked4 = ($value == 40) ? 'checked' : ''; $checked5 = ($value == 50) ? 'checked' : ''; $checked6 = ($value == 60) ? 'checked' : ''; $checked7 = ($value == 70) ? 'checked' : ''; $checked8 = ($value == 80) ? 'checked' : ''; $checked9 = ($value == 90) ? 'checked' : ''; $checked10 = ($value == 100) ? 'checked' : ''; if ($isEditableField == false) { $disabled = 'disabled'; } $html .= "<div class=\"ccm-rating\" id=\"ccm-rating-{$field}\">
Viewing 15 lines of 26 lines. View entire code block.
Thanks!