Closed (won't fix)
Project:
Fivestar
Version:
6.x-1.19
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Nov 2008 at 19:30 UTC
Updated:
12 Apr 2016 at 14:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
quicksketchCurrently you cannot edit the labels for Fivestar CCK fields through the UI. You can implement a hook_form_alter() in a custom module to change it manually.
Comment #2
Flying Drupalist commentedThank you quicksketch. I'll go do that. :)
Comment #3
jazzdrive3 commentedI'm needing the same thing. Is there a quick tutorial on how to do this?
Changing the labels on cck fields is pretty important for the advanced reviews I'm doing.
Comment #4
jazzdrive3 commentedOr can you just let me know where in the code I can hard code the changes I want. They will be the same sitewide. Which file is this info in?
Thanks!
Comment #5
japanitrat commentedCheck this patch out for the D6 version (you need to go to the field settings and save them to 'enable' the labels for a certain field)
Comment #6
japanitrat commentedComment #7
Flying Drupalist commentedHmm, can someone commit this please?
Comment #8
jazzdrive3 commentedYes please. I can never get patches to work.
Comment #9
bomarmonk commentedThis patch worked rather nicely, except that it doesn't work with fivestar and the nodereview module (there is a 6.x version posted in the issue ques). It would be great if the fivestar labels could be used by the nodereview axis settings. Any possibility of hooking into nodereview with this patch? Or does nodereview need to hook into this new feature for fivestar? I'm attaching a patched version of fivestar_field.inc for those who want to test but have difficulty applying patches.
Comment #10
Anonymous (not verified) commentedThere seems to be a bug on line 259 of the patched file (line 90 in the original patch):
for($i=0; $i < $stars; $i++) $labels[] = $field['label_'.$i];
should be:
for($i=0; $i <= $stars; $i++) $labels[] = $field['label_'.$i];
The bug results in the label of the last star always being set to a default value.
Can anyone out there confirm or deny my suspicions?
Comment #11
talatnat commentedConfirm that the last star gets set to the default value if the labels are changed (remains at 'Give it 3/3' for a three-star widget), and also confirm that the fix proposed solves this. (I used the zip file.)
This works fine on the Fivestar CCK field of a certain content-type form. However, after the node is published, hovering on the stars does not display the star labels. So, if one's labels are Poor, Good, Best for three stars, then a 2-star rating does not display Good on mouseover. Can someone confirm this? If not, can we add this to the Feature Request?
Comment #12
ManyNancy commentedComment #13
shawn dearmond commentedHere's how to use hook_form_alter() to add the labels to your form:
Comment #14
halloffame commentedHow do you implement this with the default fivestar that comes along with the content type? I can't seem to find the field name of it. What would be its field name?
I know I can just edit the label via the content type ui but I'm looking to add a div class or a class around the labels. This would probably be the best way to do that.
Comment #15
theodorosploumisThis is a fixed "fivestar_field.inc" for version 6.x-1.19, also tested for 6.x-1.x-dev.
Some changes have been done in the code after the patch from http://drupal.org/node/333059#comment-1160475 applied (this patch was for 1.13 version).
You should replace your existing file at modules/fivestar/fivestar_field.inc with this one in order to have custom labels for fivestar.
Notice that if you set the "Number of Stars:" option, for example, at 4 you can only edit 4 custom labels and any other change on a label will not be saved!
Thanks for the patch japanitrat!
Comment #16
ericduran commentedIt looks like this patch need to be rerolled.
Comment #17
chinita7 commentedThanks for committing this patch. It works great ! The only thing is that Is it possible also to display the label on the node viewing page? Because the labels are showed only on node editing page. It will be wonderful if I can display the stars with respecting label next to them.For example if 2 stars are labeled as 'good', then on the node viewing page the stars(2 of them) are showed with the label 'good'
Is this possible?
Comment #18
whiteph commentedSorry, Drupal 6 is end of life, and is no longer supported.