How about adding the google microdata option? http://www.google.com/support/webmasters/bin/answer.py?answer=176035

CommentFileSizeAuthor
#11 2011-04-05-fivestar-rdfa.JPG48.42 KBsilkogelman

Comments

cleaver’s picture

It might be worthwhile looking into the general direction of Drupal support for semantic web. I think that D7 is going in the direction of RDF, so microformats might not be so widely supported throughout the rest of Drupal. I don't know if it has to be either/or, but I think if you put effort into just one, then RDF should be it.

The second consideration is whether RDF (or microformats) should be an option built into the module, or should be an add-on module, or in theming.

cleaver’s picture

A link with more details from the another (duplicate) issue: http://googlewebmastercentral.blogspot.com/2009/05/introducing-rich-snip...

Oh, and FWIW, apparently it works with RDFa as well as microformats. I'd say that RDFa would be the direction to go.

bkosborne’s picture

I display an average fivestar review of my products using nodecomments/fivestar/votingapi

I simply followed googles documentation and wrapped the fivestar info in RDFa tags. Works like a charm.

cleaver’s picture

@bkosborne I assume you are doing this in your theme... Is that correct? Would you care to share some code as this seems to be something that is coming up more and more?

Thanks!

Michsk’s picture

if bkosborne won't have the time, i think i could supply this today or atleast tomorrow.

bkosborne’s picture

<div typeof="v:Review-aggregate" xmlns:v="http://rdf.data-vocabulary.org/#">
  <span style="display: none;" property="v:itemreviewed">Stainless Steel 3 Quart Saucepan with Cover</span>
  <span rel="v:rating">
    <span typeof="v:Rating">
      <div><a href="#reviews"><span property="v:rating">5</span> stars out of 5 stars</a></div>
    </span>
  </span>
  <div>Based on <span property="v:count">1 Review</span></div>
</div>

Google hasn't re-indexed it yet so I don't know if it worked yet. That's the output from my note-product.tpl.php file... So there's php and whatnot in there that shows that.

dgtlmoon’s picture

subscribing

silkogelman’s picture

@bkosborne (and others)
Waiting for reindexation is not necessary, Google has a testing tool for this:
http://www.google.com/webmasters/tools/richsnippets

ericduran’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev

I've actually been working on adding rdfa to the d7 branch, not sure what the correct approach will be for the d6 version, but I think this should be done in d7 1st and then d6.

cleaver’s picture

That makes sense to start in D7, but it would be great to backport as well.

silkogelman’s picture

StatusFileSize
new48.42 KB

Definitely D7 first, I agree.

I'm not really familiar with the Fivestar code, reading through it made me wonder how to approach basic RDFa support.
First I thought of adding a new formatter duplicating default, rating and pecentage to create RDFa variants, but I'm not sure that's the right way to go.

altering or overriding theme functions like theme_fivestar_static: we could let it depend on a setting in the Fivestar voting form so it's configurable per content type (example in attachment).
But maybe depending on the formatter is better?

I really need to dive deeper into this before I can say somethig sane about it, so every piece of advice an direction is appreciated. I love to help out with RDFa support f possible.

ericduran’s picture

@s1l, I don't think that checkbox is needed, it should know to print out rdfa markup if the rdfa module is enabled.

I'm curious as to what people think. Should we support rdfa or microformats? Drupal 7 has support for rdfa which makes it be the obvious choice but just soliciting some responses for now.

microformats are a lot easier ;-) but is not really about complexity.

ericduran’s picture

Also microformats can also be implement in d6, rdfa not so much.

silkogelman’s picture

If the community chose for rdfa I think we should look at the future (D7) and not make the decision hinge on backward compatibility (D6).

Please correct me if I'm wrong, but getting something like this to work
http://www.google.com/support/webmasters/bin/answer.py?answer=173379
is partly Fivestar and partly done with other Drupal modules.
So if everybody goes for D7 rdfa we can learn from eachother and rdfa may be the 'easier' choice after all.

Anonymous’s picture

I can help with this. I maintain Google Rich Snippets module and wrote an article about Rich Snippets for IBM developerWorks. I focused on RDFa and I think that is the way to go, but I can also help with this if you go the microdata route.

My personal opinion is that microdata is close enough to RDF and that it is easier to implement if you are hand coding your HTML. However, in Drupal 7 you have the RDF Mapping API which gives you an abstraction of the mapping. Having an abstraction that can be used outside of the templates is very handy and helps to keep the data structured properly no matter whether it is being themed in HTML or in another format.

RDFa actually can be implemented in D6, though support is much better in D7.

EDIT: I just realized you said microformats, not microdata. Whoops!

Anonymous’s picture

Is there any distinction in the module between 5 star ratings based on one particular reviewer and 5 star ratings based on a whole group of people? In the Google specification, they make the distinction. They will show the name of the reviewer if it is one person, or the total number of reviewers in the other case.

http://www.google.com/support/webmasters/bin/answer.py?answer=146645

ericduran’s picture

Well actually getting google to read the rich snippet is a very simple task with microformats which I've done for other projects.

The question is mostly which route do we want to go, as linclark mention in D7 there is the rdfa mapping api.

I guess we probably should do rdfa for d7 and micro formats for d6. Seems to make sense.

ericduran’s picture

@linclark, well the standard fivestar implementation is an aggregated review when you're voting on a node.

The difference is really when your using fivestar as a field, with out specifying another target then essentially that becomes an individual review. But essentially we should do the aggregated one 1st then be more specific.

Taxoman’s picture

Subscribing.

chawl’s picture

subs

dropbydrop’s picture

i didn't get it finally.
Is there any solution currently to use fivestar with rdfa/google rich snippets or not?
Can it be done with custom theme template tpl.php?

Is there any other module for the same job?

thanks

ericduran’s picture

Right now the module does not produce the mark-up needed automatically.

But you can do it in the templates. Check out http://www.marthastewart.com/284576/pesto-pizza-recipe

This is using fivestar and if we run it through google (http://www.google.com/webmasters/tools/richsnippets?url=http%3A%2F%2Fwww...) you will see is completely valid.

dropbydrop’s picture

1. http://www.marthastewart.com/284576/pesto-pizza-recipe
at this site source code, I saw only classes and not any rich snippets. i m wondering how it works.

2. anyway, i m thinking of doing my own tpl.php template using rdfa. the matter is how i can break up and get the values saperately? how i can get just the average and just the number of votes? using which variables?

3. is there any ETA for fivestars using rich snippets?

ericduran’s picture

@dropbydrop is done with microformats. Which is pretty much classes and attributes.

I'm not entirely sure which route fivestar will go, rdfa makes more sense for d7 and maybe microformats for d6.

The issue is really the logic. I honestly haven't spend much time on it yet, but probably will in the next couple of weeks. I'm hoping to have fivestar for drupal 7.x with a full 2.0 release by June.

So this feature should be in by next week if it doesn't become problematic. I'm probably thinking the logic for aggregated vs reviews and other stuff.

That being said. Patches are always welcome ;)

silkogelman’s picture

@ericduran: your estimated roadmap sounds great!
if you have a dev version that needs testing RDFa, I'll test it untill it breaks ;)
My usecase is to test it in combination with the Recipe content type from the Recipe module.

RDFa overview of the Recipe content type (is has almost everything working by default!)
#1133422: Recipe content type
and
http://drupal.org/project/recipe
A great module if you want RDFa enabled recipes on your Drupal site.

Fidelix’s picture

I do believe RDFa is also the best option for Drupal 6. It can be just as easily implemented as microformats.

Anonymous’s picture

RDFa output in Drupal 6 is buggy, unless you are hand coding it into the templates.

dropbydrop’s picture

I hopw to see this fixed soon

silkogelman’s picture

Google, Bing and Yahoo just joined forces in terms of metadata.
more info at
#1178022: Why use schema.org terms in Drupal

Michsk’s picture

yeah just read about it and allready implemented it in one project.
http://schema.org for more info

dropbydrop’s picture

ericduran’s picture

Yep, clearly that's the route we'll take now.

ericduran’s picture

Priority: Normal » Major

Ok, so now the latest version of fivestar now only supports fivestar fields and we separated out the widgets for individual review vs aggregate reviews.

So this is actually possible now. We should be able to provide all the markup require for both situations.

Moving up to major.

Adam S’s picture

How do I include RDFa markup with the fivestar widget per http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=1466...?

ericduran’s picture

@Adam S this is what this issue is about. This is still not possible out of the box, but it is possible for you to do it yourself.

See http://drupal.stackexchange.com/questions/4175/google-rich-snippets-cust... for how to get the data you need.

dropbydrop’s picture

@ericduran Well the stackexchange post also link to the post here for more information.
We would like two extra value output from fivestar. Aggregate Rating value, Best Rating Value, Number of Ratings.
See more info at http://schema.org/AggregateRating

Maybe these should be as hidden extras at the fivestar star widget.
Ways to do it are mentioned at http://www.google.com/support/webmasters/bin/answer.py?answer=172705 .

Please adapt fivestar code accordingly.

Thanks

Quarantine’s picture

Subscribed.

BarisW’s picture

This would be awesome! Bump ;)

ericduran’s picture

Status: Active » Fixed

This post can be closed. The latest fivestar version integrates with the microdata (http://drupal.org/project/microdata) module.

BarisW’s picture

Cool, thanks!

djschoone’s picture

Great!

Status: Fixed » Closed (fixed)

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

Marko B’s picture

I also made my own microdata for drupal 6 with templating

http://www.drupaldump.com/microdata-voteing-modules