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

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.

share|improve this question

migrated from stackoverflow.com Jan 22 at 16:42

This question came from our site for professional and enthusiast programmers.

    
Not sure I follow your HTML structure, but in the third line of your code 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. –  dan Jan 22 at 17:00
    
As far as I understand, all itemprops are properties of the parent node. So the "about" property belongs to WebPageElement in this case. And the about property is supposed to be a Thing, which Product is a subclass of. –  Truls Jan 23 at 9:55
    
Does that work then? ;-) The schema.org table for Product lists the Properties from Thing and the Properties from Product that can be used - about is not one of those. Just trying to help you fix the error you're seeing. –  dan Jan 23 at 15:29
    
Sure, but please look at it this way: WebPageElement has a property called "about". It is supposed to be "The subject matter of the content" and of type Thing. The Product is a Thing. So in my case, the Product is a property of WebPageElement. Is that logic wrong? –  Truls Jan 23 at 18:17
    
See my update. I think I got it working...? –  Truls Jan 23 at 18:51
add comment

1 Answer 1

I stumbled upon an article saying one may need to declare itemprop in the html element, like this:

<html lang="sv" itemscope itemtype="http://schema.org/Product" itemprop="[canonical]">

where [canonical] is to be replaced with the actual canonical link of the page.

I am not sure if this will solve the problem. If not, there is a schema creator that may be helpful at http://schema-creator.org/product.php

share|improve this answer
1  
Sorry, this did not have any effect on the result. Also the Product needs to be a part of the page, not the page itself. Using WebPage instead of Product in your example did not help either. –  Truls Jan 22 at 9:39
add comment

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.