I'm still testing fivestar and microdata.

From what I can see, at the moment, ratingCount property is not supported by fivestar and microdata modules so it is not possible to use http://schema.org/AggregateRating

With http://schema.org/Rating I'm unable to make the "stars" appear in the google rich snippet testing tool.

Files: 
CommentFileSizeAuthor
#43 1445944-32-modified.patch3.64 KBdaemonchrist
PASSED: [[SimpleTest]]: [MySQL] 115 pass(es).
[ View ]
#34 1445944-34.patch3.87 KBroderik
PASSED: [[SimpleTest]]: [MySQL] 115 pass(es).
[ View ]
#32 1445944-32.patch3.75 KBroderik
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1445944-32.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#31 micro.png26.3 KBimoreno
#29 1445944-29.patch2.78 KBroderik
PASSED: [[SimpleTest]]: [MySQL] 115 pass(es).
[ View ]
#22 micro1.png22.36 KBeule
#22 micro2.png27.54 KBeule
#18 1445944-18-fivestar_ratingcount_schemaorg.patch2.61 KBcolette
PASSED: [[SimpleTest]]: [MySQL] 115 pass(es).
[ View ]

Comments

ericduran’s picture

Category:feature» bug

Hmm, 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.

dimon00’s picture

I'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.

stayontherun’s picture

You 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

Why doesn't the rich snippets testing tool show a preview of my search result snippet?

Currently, you can use the testing tool to see what information Google can extract from your pages. We're working on updating the tool so you can see how content marked up with schema.org might appear in search results.

ericduran’s picture

Status:Active» Closed (duplicate)

This should be comments in the same issue as the patch not here.

ericduran’s picture

Status:Closed (duplicate)» Active

re-opening. Lets get this fixed.

dimon00’s picture

@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

linclark’s picture

Title:Missing ratingCount on microdata» Missing properties (e.g. ratingCount) on microdata

I 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.

dimon00’s picture

Maybe 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.

linclark’s picture

Just 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:

  • averageRating
  • ratingCount

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.

dimon00’s picture

Any news on this?
Any way we can help?

linclark’s picture

Yes:

I need a list of the data that is output by all of the field formatters.

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.

dropbydrop’s picture

any news?

linclark’s picture

I need a list of the data that is output by all of the field formatters.

As 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.

dropbydrop’s picture

I volunteer if I will understand what/how to do it.
Please give an example. Thanks

linclark’s picture

As I said in #9, examples of properties that are output in the formatters are:

  • averageRating
  • ratingCount
dropbydrop’s picture

These are enough for google rich snippets. We don't need anything more.
So, we may proceed just with these.

dimon00’s picture

I 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

colette’s picture

Status:Active» Needs review
StatusFileSize
new2.61 KB
PASSED: [[SimpleTest]]: [MySQL] 115 pass(es).
[ View ]

I wrote a patch publishing microdata for ratingCount.

dimon00’s picture

Thank 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. :)

eule’s picture

Hi
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 ???

dimon00’s picture

Since 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:

<div class="description"><div class="fivestar-summary fivestar-summary-average-count"><span class="average-rating">Average: <span  itemprop="ratingValue">3.2</span></span> <span class="total-votes"><span  itemprop="ratingCount">5</span> votes</span></div></div>
</div>

Maybe you have got a misconfiguration. Can you post an image of your microdata setting for the fivestar field you are using?

eule’s picture

StatusFileSize
new27.54 KB
new22.36 KB

hey,

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

dimon00’s picture

@eule: contact me directly.

Maybe together we can sort it out. ;)

imoreno’s picture

Hi 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

dimon00’s picture

Hello 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.

Steffan.Hernandez’s picture

@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

hass’s picture

Status:Needs review» Needs work
+++ b/includes/fivestar.field.incundefined
@@ -727,6 +727,11 @@ function fivestar_property_info_callback(&$info, $entity_type, $field, $instance
+      'label' => t('Rating Count'),

"Rating count"

+++ b/includes/fivestar.theme.incundefined
@@ -266,11 +267,17 @@ function theme_fivestar_summary($variables) {
+    $output .= ' <span class="total-votes">'. format_plural($votes, '<span !microdata>@count</span> vote', '<span !microdata>@count</span> votes', array('!microdata' => $rating_count_microdata)) .'</span>';

This is broken code. We cannot import these strings from PO files.

+++ b/includes/fivestar.theme.incundefined
@@ -266,11 +267,17 @@ function theme_fivestar_summary($variables) {
+    $output .= ' <span class="total-votes">('. format_plural($votes, '<span !microdata>@count</span> vote', '<span !microdata>@count</span> votes', array('!microdata' => $rating_count_microdata)) .')</span>';

This is broken code. We cannot import these strings from PO files.

hass’s picture

roderik’s picture

Status:Needs work» Needs review
StatusFileSize
new2.78 KB
PASSED: [[SimpleTest]]: [MySQL] 115 pass(es).
[ View ]

Reroll. (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.

imoreno’s picture

Works for me. ratingCount is now available on the microdata configuration for content types that uses fivestars.

imoreno’s picture

StatusFileSize
new26.3 KB

Hi,
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:
microdata

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

roderik’s picture

StatusFileSize
new3.75 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1445944-32.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Silly 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 $votes a 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.

Status:Needs review» Needs work

The last submitted patch, 1445944-32.patch, failed testing.

roderik’s picture

Status:Needs work» Needs review
StatusFileSize
new3.87 KB
PASSED: [[SimpleTest]]: [MySQL] 115 pass(es).
[ View ]

Meh. 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.

imoreno’s picture

Well, aggregate rating is still missing. any ideas on how to solve this one?

roderik’s picture

Sorry, 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.

daemonchrist’s picture

I can confirm that patch #34 is working with latest dev and produces correct results.

Frank HH-germany’s picture

Hello,
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

whiteph’s picture

Issue summary:View changes

Which 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.

Frank HH-germany’s picture

Hi,
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

whiteph’s picture

Status:Needs review» Fixed
daemonchrist’s picture

Status:Fixed» Needs review

I'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...

daemonchrist’s picture

StatusFileSize
new3.64 KB
PASSED: [[SimpleTest]]: [MySQL] 115 pass(es).
[ View ]

Here'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.

whiteph’s picture

Thanks :)

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.

whiteph’s picture

After 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.

whiteph’s picture

Component:Documentation» Code
Status:Needs review» Fixed

Status:Fixed» Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Frank HH-germany’s picture

@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