I want to define a Product as the main content of a webpage using Schema.org markup. My idea with the following HTML is to use the structure:
- Webpage
-- WebPageElement (mainContentOfPage of Webpage)
--- Product (about of WebPageElement which is mainContentOfPage of Webpage)
However, using this markup, Google does not seem to recognize the Product properties such as the aggregateRating. The "structured markup tool" is only satisfied if I remove the "about" property on Product. But then the structure breaks into:
- Webpage
-- WebPageElement (mainContentOfPage of Webpage)
-- Product
Product is no longer a part of WebPageElement. Even if I use the property "mainContentOfPage" directly on the Product node, I get the same result: The Product is not recognized properly. It seems like the Product node cannot have any itemprops. So how should I proceed?
<body itemscope itemtype="http://schema.org/WebPage">
<div itemscope itemtype="http://schema.org/WebPageElement" itemprop="mainContentOfPage">
<div itemprop="about" itemscope itemtype="http://schema.org/Product">
<h1 itemprop="name">Acme Toaster Oven</h1>
<div itemprop="description">It toasts AND bakes.</div>
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">Rated <span itemprop="ratingValue">3</span>/5 based on <span itemprop="reviewCount">2</span> reviews</div>
<div itemprop="review" itemscope itemtype="http://schema.org/Review"><span itemprop="name">A great toaster</span> - by <span itemprop="author">John</span>,
<meta itemprop="datePublished" content="2013-10-16">October 26, 2013
<div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"><span itemprop="ratingValue">5</span>/5</div>
<span itemprop="reviewBody">First I had bread. Then I had toast. Magic!</span>
</div>
<div itemprop="review" itemscope itemtype="http://schema.org/Review"><span itemprop="name">A small oven</span> - by <span itemprop="author">Mary</span>,
<meta itemprop="datePublished" content="2013-10-16">October 26, 2013
<div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"><span itemprop="ratingValue">1</span>/5</div>
<span itemprop="reviewBody">My 18-pound turkey wouldn't fit in this thing.</span>
</div>
</div>
</div>
</body>
The HTML can be tested here: http://www.google.com/webmasters/tools/richsnippets
Update
After experimenting with "itemref", I got pretty good results with this code in Google's tool and Yandex and the Structured Data Linter.
<body itemscope itemtype="http://schema.org/WebPage">
<div itemscope itemtype="http://schema.org/WebPageElement" itemprop="mainContentOfPage">
<meta itemprop="about" itemscope itemtype="http://schema.org/Product" itemref="theProduct" />
</div>
<div id="theProduct">
<h1 itemprop="name">Acme Toaster Oven</h1>
<div itemprop="description">It toasts AND bakes.</div>
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">Rated <span itemprop="ratingValue">3</span>/5 based on <span itemprop="reviewCount">2</span> reviews</div>
<div itemprop="review" itemscope itemtype="http://schema.org/Review"><span itemprop="name">A great toaster</span> - by <span itemprop="author">John</span>,
<meta itemprop="datePublished" content="2013-10-16">October 26, 2013
<div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"><span itemprop="ratingValue">5</span>/5</div>
<span itemprop="reviewBody">First I had bread. Then I had toast. Magic!</span>
</div>
<div itemprop="review" itemscope itemtype="http://schema.org/Review"><span itemprop="name">A small oven</span> - by <span itemprop="author">Mary</span>,
<meta itemprop="datePublished" content="2013-10-16">October 26, 2013
<div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"><span itemprop="ratingValue">1</span>/5</div>
<span itemprop="reviewBody">My 18-pound turkey wouldn't fit in this thing.</span>
</div>
</div>
</div>
</body>
The only side effect is that the reviews and aggregateRating seem to connect to both the WebPage and the Product. I don't know if that's bad.
about
is not property that's nested under Product, so you will get errors with the Structured Data Testing Tool and Google likely isn't going to display it until you fix that.Properties from Thing
and theProperties from Product
that can be used -about
is not one of those. Just trying to help you fix the error you're seeing.