Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Please note this code:

<html itemscope itemtype="http://schema.org/WebPage">
<head>
  <meta itemprop="name" content="webpage"/>
</head>

<body>
  <div itemprop="mainContentOfPage" itemscope itemtype="http://schema.org/Article">
    <span itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating">
      <meta itemprop="ratingValue" content="4">
      <meta itemprop="worstRating" content="0">  
      <meta itemprop="bestRating" content="5">                  
      <meta itemprop="ratingCount" content="100">
    </span>
  </div>      
</body>
</html>

If I add an AggregateRating inside the div tag for article, Google Labs does not show the values of AggregateRating on its URL result So I must remove itemprop="mainContentOfPage" or add AggregateRating out of the div tag or add both.

How can I fix this problem?

AggregateRating belongs to AggregateRating, not WebPage!?

For a solution I changed the code to this:

<html itemscope itemtype="http://schema.org/WebPage">
<head>
  <meta itemprop="name" content="webpage"/>
</head>

<body>
  <span itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating">
      <meta itemprop="ratingValue" content="4">
      <meta itemprop="worstRating" content="0">  
      <meta itemprop="bestRating" content="5">                  
      <meta itemprop="ratingCount" content="100">
    </span>

  <div itemprop="about mainContentOfPage" itemscope itemtype="http://schema.org/Article">
    <span itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating">
      <meta itemprop="ratingValue" content="4">
      <meta itemprop="worstRating" content="0">  
      <meta itemprop="bestRating" content="5">                  
      <meta itemprop="ratingCount" content="100">
    </span>
  </div>      
</body>
</html>

But I'm not sure it's true or not!

share|improve this question
    
Have you tried using google labs to test it? if it works then its right. If you have answered your own question, please remove it from the question and click answer this question yourself. –  Liam Sorsby Apr 3 at 10:27
    
NO,I think google lab can not recognize that. You can use each property for any Things and google lab do not return any error! –  user2726957 Apr 3 at 10:40
    
search appearance > structured data? –  Liam Sorsby Apr 3 at 10:41
    
1  
how are you testing with lab if your using localhost? –  Liam Sorsby Apr 3 at 15:47

1 Answer 1

Okay. I understand that the schema.org markup is confusing and I am hardly an expert.

I removed a few items that did not make sense to me and changed your meta statements to spans. I noticed in answering a previous question that the meta statements do not work. I recommend using span instead.

<html>
<head>
</head>

<body>
  <div itemprop="mainContentOfPage" itemscope itemtype="http://schema.org/Article">
    <span itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating">
      <span itemprop="ratingValue">4</span>
      <span itemprop="worstRating">0</span> 
      <span itemprop="bestRating">5</span>
      <span itemprop="ratingCount">100</span>
    </span>
  </div>      
</body>
</html>

The above code works in the Google Rich Snippets Tool okay.

The AggregateRating could optionally be followed by Review to list some or all of the reviews if you want.

share|improve this answer
    
Thanks for The answer...But HTML tag has this Microdata: "<html itemscope itemtype="schema.org/WebPage">"; and I do not want remove it! –  user2726957 Apr 3 at 17:59
1  
I am not stopping you. Go for it! I took it out because it clouded the AggregateRating when testing it which I was assuming was not working as you expected. AggregateRating is nested within Article within my sample. Schema.org markup can get a bit hinky from time to time. When you re-add WebPage, just be sure to watch the nesting to make sure there is no confusion. –  closetnoc Apr 3 at 18:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.