Closed (fixed)
Project:
Fivestar
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Feb 2012 at 18:02 UTC
Updated:
16 Mar 2014 at 12:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ericduran commentedHmm, fivestar does actually support this. Or at least the latest dev is supposed to support this feature we already have the code for it.
I'm switching this to a bug report.
what kind of fields are you using for display. I think it might be is only supported on "stars (without voting)" widgets.
I'll look into this.
Comment #2
dimon00 commentedI'm using "Stars (rated while viewing)" using the patch in http://drupal.org/node/1379072
A sample page:
http://www.centrovolantini.it/volantino-trony
Google snippet doesn't show the count:
http://www.google.com/webmasters/tools/richsnippets?url=http://www.centr...
ratingCount is not in the page source.
Comment #3
stayontherun commentedYou are right dimon00, I also used the patch above. I checked fivestartheme.inc and there is no microdata code in it for ratingCount, only for ratingValue. I don't know how to do this, maybe someone else can add ratingCount support to the patch mentioned above.
I cannot see stars, too. But I've read that Rich Snippet Tool is still in developement and doesn't work correctly.
See Webmaster Tools schema.org FAQ
Comment #4
ericduran commentedThis should be comments in the same issue as the patch not here.
Comment #5
ericduran commentedre-opening. Lets get this fixed.
Comment #6
dimon00 commented@msedlacek you should post your workaround here as well. It could help others as long as we don't find a proper solution. :)
@ericduran I cannot see any reference in fivestar code to "ratingCount".
Can you point me in the right direction?
Thanks
Comment #7
Anonymous (not verified) commentedI have a Google Summer of Code student dedicated to this now, so I can assign her to this.
Can someone provide a full list of the properties in Fivestar that need to be supported? I picked out the averageRating just to demonstrate how microdata works, but didn't dig in deep enough to see what the other properties are.
Comment #8
dimon00 commentedMaybe ericduran has a list.
From my part I believe we should map http://schema.org/AggregateRating properly.
Probably, in this moment, the most urgent missing property is ratingCount.
Comment #9
Anonymous (not verified) commentedJust to be clear for Eric or whoever wants to take this on, I need a list of the data that is output by all of the field formatters.
So far, we have:
For now, it doesn't matter how Schema.org uses these values. We just want to know what data the module's field formatters publish.
I will assign this as a task to the GSOC student once a full list has been compiled.
Comment #10
dimon00 commentedAny news on this?
Any way we can help?
Comment #11
Anonymous (not verified) commentedYes:
This means I need a list of all of the potential properties of the Fivestar field. If this can be provided, then this can be the next priority for my GSOC student.
Comment #12
dropbydrop commentedany news?
Comment #13
Anonymous (not verified) commentedAs I said to the last two people who asked, I need someone to figure out all of the data that Fivestar outputs in all of the formatters and post that list here.
There will be no news until someone volunteers to do this.
Comment #14
dropbydrop commentedI volunteer if I will understand what/how to do it.
Please give an example. Thanks
Comment #15
Anonymous (not verified) commentedAs I said in #9, examples of properties that are output in the formatters are:
Comment #16
dropbydrop commentedThese are enough for google rich snippets. We don't need anything more.
So, we may proceed just with these.
Comment #17
dimon00 commentedI don't think anybody is going to provide a list of the properties.
@Linclark do you think you can add the single more requested feature: the support for ratingCount?
Can we help somehow?
Thank you
Comment #18
colette commentedI wrote a patch publishing microdata for ratingCount.
Comment #19
dimon00 commentedThank you, Colette.
I was able to apply the patch manually but:
- first part of the patch is not for fivestar.module but for microdata.api.php
- I had to strip the brackets from the output command otherwise google snippet tool wasn't able to recognize the itemprop ratingCount.
Here the change:
from:
$output .= ' ('. format_plural($votes, '@count vote', '@count votes', array('!microdata' => $rating_count_microdata)) .')';
to:
$output .= ' '. format_plural($votes, '@count vote', '@count votes', array('!microdata' => $rating_count_microdata)) .'';
Thanks to your patch now the snippet tool is able to generate a good looking search result. I hope it is going to appear in that way in google soon. :)
Comment #20
eule commentedHi
i can´t get it working..i get always only
<div class="field-item even">instead of<div class="field-item even" itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating">any help please?
and @dimon00 how did u get this item and item1 ???
Comment #21
dimon00 commentedSince this morning I can see the stars in google search results!!!
I hope it is going to give me more clicks. :)
@eule I see the fivestar widget as item 1
here is an example:
http://www.google.com/webmasters/tools/richsnippets?url=http://www.centr...
In the source of the page, used in the example above, you can see:
Maybe you have got a misconfiguration. Can you post an image of your microdata setting for the fivestar field you are using?
Comment #22
eule commentedhey,
i really don´t know what i can make wrong...maybe my theme can´t work with it?
here the pictures @dimon00 ...maybe i can write you a private msg and you will help me?
i make all the patches by hand but the snippet tool dislike it
Comment #23
dimon00 commented@eule: contact me directly.
Maybe together we can sort it out. ;)
Comment #24
imoreno commentedHi dimon00,
What are the current releases versions you are using for both five stars and microdata?
Is it still working for you?
what do i need to apply / patch in order to make it work with google snipest tool? I want it to display the aggregate votes number and the average voting for an item.
any help with this feature would be grate,
BR
Itzhak
Comment #25
dimon00 commentedHello imoreno,
for my production system I'm using:
fivestar 7.x-2.0-alpha2+5-dev
Voting API 7.x-2.6
7.x-1.0-beta2+15-dev
Microdata 7.x-1.0-beta2+15-dev
you shouldn't need any patch with this combination.
here is an example link:
http://www.centrovolantini.it/volantino-mediaworld
you can verify with the google rich snippet tool.
Hope it helps.
Comment #26
Steffan.Hernandez commented@dimon00
What are you referring to when you say for example fivestar 7.x-2.0-alpha2 "+5-dev"
Are these patches you have applied to these current versions?
I have all of these modules with the exact versions but not with the "+5-dev" "+15-dev" etc
I'm still a drupal newbie so I apologize if this is a stupid question.
cheers
Comment #27
hass commented"Rating count"
This is broken code. We cannot import these strings from PO files.
This is broken code. We cannot import these strings from PO files.
Comment #28
hass commented#1835476: Cannot translate "Average: <span !microdata>!stars</span>" is a duplicate.
Comment #29
roderikReroll. (Will probably apply with 1 line offset because it's against source code that has #1835476 fixed.)
I also took the liberty to move some code around, because in the case where $votes === 0, $output was first built up and then thrown away.
Comment #30
imoreno commentedWorks for me. ratingCount is now available on the microdata configuration for content types that uses fivestars.
Comment #31
imoreno commentedHi,
I'm using panels and it is not working properly for me.
when looking into the HTML i don't see any
<div class="field-item even" itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating">whatever i tried to do it won't find it's way from the configuration page to the actual HTML
this is how it is configured on my end:

If anyone has any suggestions on how to make it work or configure it in any other way i would love to hear!
BR
Itzhak
Comment #32
roderikSilly me. In #29 I introduced a situation where code execution was changed: if
$votes === 0, my patch never set$div_class = 'count'anymore.I separated the assignment of
$votesa bit from the rest, while making sure that the assignment still happens under the exact same conditions as it used to.For clarification: #30/#31 got its own issue (#1965140: microdata schema type "AggregateRating" is missing in fivestars output) and seems to be purely related to panels. Works for me. So we can continue as-is... this is still colette's patch adjusted to incorporate hass' comments.
Comment #34
roderikMeh. This patch includes #1835476-5: Cannot translate "Average: <span !microdata>!stars</span>" and is therefore now really two issues in one.
If #1835476 (which is already RTBC) gets committed, you can revert to patch #32.
Comment #35
imoreno commentedWell, aggregate rating is still missing. any ideas on how to solve this one?
Comment #36
roderikSorry, no. I just installed microdata (dev version) and fivestar with this patch - and configured things as in your screenshot. The HTML for AggregateRating shows up. (Not inside a 'div', by the way -- inside 'meta' tags somewhere in the HTML body.)
So I guess it's panels specific, and you already opened a separate issue for that (right?). Unfortunately (I wish it was different) I don't have real experience with Panels.
Comment #37
daemonchrist commentedI can confirm that patch #34 is working with latest dev and produces correct results.
Comment #38
frank hh-germany commentedHello,
I am Frank from Germany .
I'm trying now for many days and nights with the 3 known modules of schema.org, microdata and good relations ( commerce ) . The Five Star module to teach the Google -compliant syntax for the microdata . Unfortunately, the patch from # 34 does not work . There was an error in line 324 of ... theme.inc .
There was a sign . } . For the right uncomment the syntax would also like Google that the lowest rating possible (1 (worst rating )) and the highest rating possible (usually 5 ( bestRating ) ) is commented out.
Then it work well with the Structured Data Test .
Since it is precisely the microdata for administrators are also very important, I 'm thinking about it , why not the same Mirkrodaten directly in the module via the selection field ( hook ) on or can be turned off.
Unfortunately, I am familiar with the programming of very little.
My Kungfu ends at the simplest things .
Maybe someone has a solution on how to integrate the four micro data directly into the Five Star module ?
Thanks in advance for the help.
Best regards from Hamburg-Germany
Translated with Google
------------------------------------
Hallo,
Ich bin Frank aus Deutschland.
Ich versuch nun seit vielen Tagen und Nächten mit den 3 bekannten Modulen schema.org, microdata und Good relations (Commerce). Dem Fivestar-Modul die Googlekonforme Syntax für die Mikrodaten beizubringen. Der Patch aus #34 funktioniert leider nicht. Hier gab es einen Fehler in Zeile 324 von ...theme.inc.
Es fehlte ein Zeichen. }. Für die richtige Auskommentierung der Syntax hätte es Google auch gern, dass die niedrigste Bewertungsmöglichkeit (1(worstRating)) und die höchste Bewertungsmöglichkeit (in der Regel 5(bestRating)) auskommentiert ist.
Dann funktionert es auch mit dem Structured Data Test.
Da gerade die Mikrodaten für Administratoren auch sehr wichtig sind, mache ich mir darüber Gedanken, warum die Mirkrodaten nicht gleich direkt im Modul per Auswahlfeld (Haken) an oder abgeschlatet werden können.
Leider kenne ich mich mit der Programmierung nur wenig aus.
Mein Kungfu endet bei den einfachsten Dingen.
Hat vieleicht jemand eine Lösung, wie man die (4) Mikrodaten direkt in das Fivestarmodul integrieren kann?
Danke im Vorraus für die Hilfe.
Beste Grüße aus Hamburg-Deutschland
Übersetzt mit Google
Comment #39
whiteph commentedWhich version of Fivestar are you using? The 7.x-2.0-alpha3 version had four Microdata-related fixes. The new 7.x-2.0-beta1 contains all of those, plus twenty or so other fixes. If you've not tried the beta1 release, please try it and report back here.
Comment #40
frank hh-germany commentedHi,
the patch works yet with microdata. Sorry! My mistake.
Here's a link to things present results of the test page.
http://www.google.de/webmasters/tools/richsnippets?q=uploaded:8004f2bfb9...
Thank you.
Best regards from Hamburg-Germany
frank
Translated with Google
Comment #41
whiteph commentedComment #42
daemonchrist commentedI'm using beta1 and it's definitely not outputting the ratingCount property, which is required by Google.
Addtionally, as Frank HH pointed out, the patch which previously worked now fails. I'd be interested to hear what he did to get it working...
Comment #43
daemonchrist commentedHere's a fixed version of the patch from #32. I was able to apply this against 7.x-2.0-beta1, and it seems to be working for me.
Comment #44
whiteph commentedThanks :)
I have zero experience with microdata, so am not in a good position to test this. Can somebody else confirm that this patch works (and set this issue status to RTBC)? The patch looks to be straightforward, and I'd be happy to commit it once it goes to RTBC.
Comment #45
whiteph commentedAfter a week of nobody else in the microdata world testing this patch, I'm planning to commit this in the next couple of days before issuing the next (beta2) release -providing non-microdata functionality passes regression tests. If anyone is concerned, please test this patch asap. I feel that it's important that people who have bothered to contribute, e.g. @damian.christey and @Frank HH-germany, see their work accepted in a reasonable time frame.
Philip.
Comment #46
whiteph commentedComment #48
frank hh-germany commented@damian.christey
See at #38.
# 34 does not work . There was an error in line 324 of ... theme.inc .
There was a sign . }
Google accept now the snippet in the testingtool and show the stars.
Added, the patch syntax is a little hard to understand. I had to as well as purely read and try it first.
diff = file
- = remove
+ = add
Best regards from Hamburg-Germany
Does anyone have a solution for this maybe? https://drupal.org/node/2218779