September 02, 2010, 09:20:49 AM

Login with username, password and session length

FORUM POSTING GUIDELINES - Please read and follow them.

Pages: [1] 2 3
  Print  
Author Topic: Google now adds reviews in Results Page  (Read 8160 times)
eskwire
Hero Member
*****
Offline Offline

Posts: 321



WWW
« on: June 08, 2009, 09:28:57 AM »

A few weeks ago I noticed some review stars in the results listings.   Has anyone else seen these?

I looks like google is starting to support microformats and adding rich snippets in the results pages.

Here are a few articles I found when researching this topic:
http://googlewebmastercentral.blogspot.com/2009/05/introducing-rich-snippets.html
http://radar.oreilly.com/2009/05/google-adds-microformat-parsin.html
http://microformats.org/
http://microformats.org/wiki/hreview
http://www.google.com/support/webmasters/bin/answer.py?answer=146645
http://www.google.com/support/webmasters/bin/answer.py?answer=99170

After searching I found a lot of the information   The google webmaster post outlines it the best.

How much work would it be to add this to jReviews details pages?
Looks like it might be accomplished by adding some formatting to the template files.

What else do others know about this?  Has anyone implemented them on their site?
I think the could be a real help if successfully implemented.  What do you think?
Logged

If this post helped, please review your at Joomla Hosting
Win cash by leaving your honest opinion in our Joomla Hosting Review Contest
red2678
Jr. Member
**
Offline Offline

Posts: 30



« Reply #1 on: June 18, 2009, 12:16:46 PM »

I too am wondering if this could be incorporated. Anyone done this yet?
Logged
gigi
Sr. Member
****
Offline Offline

Posts: 149


WWW
« Reply #2 on: July 06, 2009, 01:53:04 PM »

wow this is great.

code wise this is very easy to implement since in fact all you need to do is add the html in the template the way google wants it.

all the variables are already there since they are currently used in the templates anyway. you just need to rearrange it.

i might do it for my own jreviews site and see if google catches it!

cheers
gigi


Logged

red2678
Jr. Member
**
Offline Offline

Posts: 30



« Reply #3 on: July 06, 2009, 02:04:48 PM »

Hi gigi.

Do you think you could lend a helping hand with the code that would need to be added?

Is there a hidden div that needs to be added? Can I add some class values to existing code?

Thanks for any help.   Grin
Logged
gigi
Sr. Member
****
Offline Offline

Posts: 149


WWW
« Reply #4 on: July 06, 2009, 02:15:11 PM »

at the moment i just have some more urgent tasks to finish but i want to do it for my own site as well so once i do that i can share the code here, no problem.

but once again there is nothing extraordinary to do jreviews wise, just understanding exactly how google wants it to look like and change the templates!

cheers
gigi

Logged

red2678
Jr. Member
**
Offline Offline

Posts: 30



« Reply #5 on: July 06, 2009, 02:36:16 PM »

Was looking some more at it. You are right, does not look to bad. I will give it a shot…

I completely understand priorities, so thanks in advance for when you do post.

Have a great day !   Grin

~Red
Logged
eskwire
Hero Member
*****
Offline Offline

Posts: 321



WWW
« Reply #6 on: July 06, 2009, 02:38:47 PM »

I may have some time and take a stab at it.

Looks like there are two possible formats: Microformats and RDFa

Any thoughts on which would be more appropriate / flexible / easier?
Logged

If this post helped, please review your at Joomla Hosting
Win cash by leaving your honest opinion in our Joomla Hosting Review Contest
red2678
Jr. Member
**
Offline Offline

Posts: 30



« Reply #7 on: July 06, 2009, 04:21:56 PM »

FIRST LET ME SAY THIS CODE IS NOT TESTED. DO NOT PUT ON A  PRODUCTION SERVER!

Ok, so I looked and decided to go with microformats. It is simply assigning additional classes to the objects and adding some span tags (sounds simple). I have made all the changes to my template except for 3, the image, count and price (the hardest I am afraid).

For those of you following, I am using this code http://1.bp.blogspot.com/_o5Na_9269nA/SgmWXpBnJKI/AAAAAAAACp0/c_PAJxONNw0/s1600-h/drooling-dog-html-microformats.png

and editing file detail.thtml in my template/listings folder.

So I have assigned the class values to the proper divisions I think:

My main DIV for the template detail is now:

Quote
<div class="jr_pgContainer jr_itemDetail hreview-aggregate">


I added a new DIV to accommodate the example. So directly after the above DIV, I added a new one, giving me:

Quote
<div class="jr_pgContainer jr_itemDetail hreview-aggregate">
<div class="item vcard">

*Make sure to add a closing </div> tag around line 430

My Item's H1 is now:

Quote
<h1 class="contentheading fn org"><?php echo $listing['Listing']['title']?></h1>


This is where I get stuck.

1.   I need to edit the rendered HTML for the image to add the class’ “rating average stars_4”.
   
     a.   In addition, those above values need to be dynamic. You will see in the example code “stars_4”,
           this would need to be something like “stars_<?php echo $rating ;?>” AS EXAMPLE, I do not know the code.

2.   I need to wrap the total count of user reviews in a SPAN tag with the class “count”

3.   I need to wrap a “price range” field (which I have) with another SPAN tag class “pricerange”

But in my template there is only the jReviews calls to its PHP variables. I am pretty sure 2 of the 3 things I need to edit are here (count and img), I am just not sure how:

Quote
            <?php if($this->Config->user_reviews):?>
               <td class="rating_label"><?php echo $Html->image($this->viewImages.'review_user.png',array('title'=>__t("User rating",true),'alt'=>__t("User rating",true)));?></td>
               <td class="rating_stars"><?php echo $Rating->drawStars($listing['Review']['user_rating'], $this->Config->rating_scale, $this->Config->rating_graph, 'user');?></td>
               <td class="rating_value"><?php echo $Rating->round($listing['Review']['user_rating'],$this->Config->rating_scale);?> (<?php echo (int) $listing['Review']['review_count'];?>)</td>
               <?php endif;?>   

The third one the “pricerange” field, seems like it would be the hardest. I have custom field “price”. Can I use this?

Any ideas from anyone following this thread?

Thanks,

~Red
« Last Edit: July 06, 2009, 04:30:18 PM by red2678 » Logged
Kristian
Global Moderator
Hero Member
*
Online Online

Posts: 2764



WWW
« Reply #8 on: July 06, 2009, 05:12:38 PM »

User rating:
Code:
<?php echo $listing['Review']['user_rating']?>

Count:
Code:
<?php echo $listing['Review']['user_rating_count']?>

The star images are rendered as div background, so I guess you need to add the class to the div, not img.

If you need a pricerange you can use your custom field.

Maybe it would be easier if you use the rendered html of your detail page and try to add all the required elements, and after you have an example how it should look like, it will be easier to make the php changes in the theme file.

« Last Edit: July 06, 2009, 05:19:29 PM by kheruc » Logged
gigi
Sr. Member
****
Offline Offline

Posts: 149


WWW
« Reply #9 on: July 06, 2009, 05:58:26 PM »

about the price range, you can output your price custom field as plain text and wrap a span around it, so it will be something like:

<span class="...."><?php echo $CustomFields->fieldText('jr_price',$listing); ?></span>

so this allows you to filter the actual text out of the custom field html. but what google actually wants to see there, once again i haven't looked into yet.

Logged

red2678
Jr. Member
**
Offline Offline

Posts: 30



« Reply #10 on: July 06, 2009, 06:47:02 PM »

Well you both are the $hit for helping me!

I think I did it right. The only issue I can see is that Google will not like the fact that the stars image are not really images but a BG. We will have to see.

What I ended up doing is making my own footer review data block. I added it just above the description and put in the required SPAN tags.  The code for that portion ended up looking like this:

Quote
<div style="width:820px;" class="contentFulltext">

               
<div style="width:190px; float:left; position:relative;">An average User Rating of </div>
                               
 <div style="width:70px; float:left; position:relative; padding-top:7px; padding-left:5;"><div class="rating average stars_<?php echo (int) $listing['Review']['user_rating']?>"><?php echo $Rating->drawStars($listing['Review']['user_rating'], $this->Config->rating_scale, $this->Config->rating_graph, 'user');?></div></div>

<div style="width:440px; float:left; position:relative;"><!--(<?php echo (int) $listing['Review']['user_rating']?>)--> based on <span class="count">(<?php echo (int) $listing['Review']['review_count'];?>)</span> reviews, with a average price range of <span class="pricerange"><?php echo $CustomFields->fieldText('jr_pricelisting',$listing);?></span></div>

</div>

You can see it in action here http://www.scvfoodguide.com/italian/frankies-new-york-italian.html or on any of the other listings on that site.

I still do not recommend putting this on a production site. My site is not too high traffic now so I can experiment.

I will post my progress and if Google contacts me or if it starts to work.

Thanks again!

I will let you all know how it goes!

~Red
Logged
gigi
Sr. Member
****
Offline Offline

Posts: 149


WWW
« Reply #11 on: July 06, 2009, 06:56:20 PM »

wouldn't it be safer to put the parenthesis outside the 'count' span, just in case google wants to only see a number there?

(<span class="count"><?php echo (int) $listing['Review']['review_count'];?></span>)

just a possible precaution.. but once again it's just guesswork since i didn't read what they really want there!

if this all works it will be cool. the stars are an eye catcher and it will attract clicks, at least for a period of time before the whole world does it.
« Last Edit: July 06, 2009, 06:58:29 PM by gigi » Logged

red2678
Jr. Member
**
Offline Offline

Posts: 30



« Reply #12 on: July 06, 2009, 07:06:25 PM »

wouldn't it be safer to put the parenthesis outside the 'count' span, just in case google wants to only see a number there?

(<span class="count"><?php echo (int) $listing['Review']['review_count'];?></span>)

just a possible precaution.. but once again it's just guesswork since i didn't read what they really want there!

if this all works it will be cool. the stars are an eye catcher and it will attract clicks, at least for a period of time before the whole world does it.

Thanks gigi! I made that change.

One other question you may know the answer to. Is there any way to disable "clicktosearch" when I pull a custom field.

You see that in my data block, I put my price listing custom field (via the method you explained), but the "clicktosearch" is enabled. Can I turn it off on just that one instance of the field?

If you don’t know, thanks anyway, you have been a tremendous help thus far.

~Red
Logged
gigi
Sr. Member
****
Offline Offline

Posts: 149


WWW
« Reply #13 on: July 06, 2009, 07:32:33 PM »

yes try to use:

array_shift($CustomFields->fieldValue('jr_price',$listing))

instead of $CustomFields->fieldText('jr_price',$listing)

since you're using images there i'm not sure this will work though, you have to give it a try. i don't have any similar setup here so i can't test it.
Logged

eskwire
Hero Member
*****
Offline Offline

Posts: 321



WWW
« Reply #14 on: July 06, 2009, 10:44:45 PM »

Okay so here is my take on adding the hreview tags.

I also opted for the microformat.  My challenge is that my rating scale is out of 10 rather than 5.  I found microformat examples for different rating scales but no examples for RDFa standard.

Google has 7 criteria listed for the microformat, I think I have been able to incorporate them all.
http://www.google.com/support/webmasters/bin/answer.py?answer=146645
item, fn, rating, reviewer, dtreviewed, description, summary.


I decided to use the hreview tags around my editor reviews.  Essentially I used all the existing elements of the editor review and added some extra information (the line above the editor review title) so that all the microformat variables are in one place on the page.

You can see the example here, look at the editor review lower in the page:
Altec Lansing inMotion Max Review

The limitation of this style is that the hreview tags are only displayed when there is an editor review. Not sure if Google can separate between editor and user reviews.

The tags and where I added them:

hreview
Added the hreview class tag to the editor rounded panel tab.
Code:
<div class="roundedPanel jr_review hreview" id="jr_reviewEditor">

item and fn tags:
In the editor review I added the product name with the item and fn tags.
Code:
<span class="item"><span class="fn"><?php echo $CustomFields->field('jr_manufacturer',$listing,false); ?> <?php echo $CustomFields->field('jr_model',$listing); ?></span></span>
(Note I did not use the listing title, I have created a few extra custom fields I use in various places.)

rating tag
here I also created new rating tags for better control.
Since I used a different scale extra tags were needed
Code:
<span class="rating"><span class="value"><?php echo $Rating->round($listing['Review']['editor_rating'],$this->Config->rating_scale);?></span> out of <span class="best">10</span></span>

reviewer tag
This also was straight forward added the review tags to the reviewer call.
Code:
<span class="reviewer"><?php echo $Community->screenName($editor_review);?></span>

dtreviewed
This was a little more involved since they want the time in iso time.
used the abbr class tag and need to figure out how to print the review create date in ISO time
this value will be added to the title statement.
Code:
<abbr class="dtreviewed" title=""><?php echo $Time->nice($editor_review['Review']['created']);?></abbr>

description
Not completely sure about this just wrapping the description span around the review itself.
Code:
<span class="description"><?php echo nl2br($editor_review['Review']['comments']);?></span>

summary
This was pretty straight forward just added the summary tags to the review title.
Code:
<span class="summary"><?php echo $editor_review['Review']['title'];?></span>


I think this pretty much gets it.  See anything I missed or suggestions?

Questions
How to print the rating scale? currently I hard coded "10" but would like the template to be flexible for different rating scales.

Print the review created date in ISO time (YYYYMMDD)?


Logged

If this post helped, please review your at Joomla Hosting
Win cash by leaving your honest opinion in our Joomla Hosting Review Contest
Pages: [1] 2 3
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!