Question

This is my HTML format for all pages:

 <html>
    <head>
      ...
    </head>
    <body>
      <p>...</p>

      <slide>...</slide>
    </body>
    </html>

I want to set Microdata for that. Which format of these is correct?

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

  <slide itemscope itemtype="http://schema.org/WPSideBar">.
    <meta itemprop="name" content="slide"/>
  </slide>
</body>
</html>

It seems above code is correct but when I check it on Google lab, it does not show that the slide tag is a child of WebPage. This is the result:

 Item 
    type:   http://schema.org/webpage
    property:   
    name:   webpage
    maincontentofpage:  
    Item 1

 Item 1
    type:   http://schema.org/article
    property:   
    name:   article

  Item 
    type:   http://schema.org/wpsidebar
    property:   
    name:   slide

So I try to solve this issue by adding a new itemprop. The best itemprop that I could find is 'text' or 'about':

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

<body>
  <p itemprop="about mainContentOfPage" itemscope itemtype="http://schema.org/Article">
    <meta itemprop="name" content="article"/>
  </p>

  <slide itemprop="about"  itemscope itemtype="http://schema.org/WPSideBar">.
    <meta itemprop="name" content="slide"/>
  </slide>
</body>
</html>

Now if I test it on Google lab the result is this:

Item 
    type:   http://schema.org/webpage
    property:   
    name:   webpage
    about:  Item 1
    maincontentofpage:  Item 1
    about:  Item 2

Item 1
    type:   http://schema.org/article
    property:   
    name:   article

Item 2
    type:   http://schema.org/wpsidebar
    property:   
    name:   slide

Apparently the problem is solved and now Google knows 'slide' is a child of WebPage! But my problem:

I do not feel good. Does this property really fit? ('about' or 'text')

Was it helpful?

Solution

Yes, if you want to relate the items to the WebPage, you have to use a property.

For the main content, we have mainContentOfPage. But what about elements that are not (part of) the main content?

Here’s a discussion about such a generic property for linking a WebPageElement to WebPage:
Am I right that WebPage lacks a generic property for linking to WebPageElement?

There is a proposal for a hasPart property: "A related CreativeWork that is included either logically or physically in this CreativeWork". This would be a good match, but until it becomes part of Schema.org (if at all), we’d have to use what is already there.

Possible existing properties could be:

text has the problem that it expects Text, not another item. citation is probably, at least according to its description, meant for more specific cases. That leaves us with mentions and about, but both aren’t really fitting either.

So I’d say: Currently there is no good solution.

Personally, I’d just omit a property and leave the item unlinked (until a suitable property gets added to Schema.org).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top