Domanda

I have doubts about the correct use of schema ImageObject.

I have a small image and a link to view it in larger size, but I don’t know exactly which of these three forms is the right one.

<span itemprop='image' itemscope itemtype='http://schema.org/ImageObject'>
<a href='big_1280x720.jpg' itemprop='contentUrl'><img src='small_90x60.jpg' itemprop='image'></a>
</span>

<span itemprop='image' itemscope itemtype='http://schema.org/ImageObject'>
<a href='big_1280x720.jpg' itemprop='image'><img src='small_90x60.jpg' itemprop='thumbnailUrl'></a>
</span>

<span itemprop='image' itemscope itemtype='http://schema.org/ImageObject'>
<a href='big_1280x720.jpg' itemprop='contentUrl'><img src='small_90x60.jpg' itemprop='thumbnailUrl'></a>
</span>
È stato utile?

Soluzione

The third one removing the first occurence of itemprop='image' is the right one.

<div itemscope itemtype='http://schema.org/ImageObject'>
  <a href='big_1280x720.jpg' itemprop='contentUrl'>
    <img src='small_90x60.jpg' itemprop='thumbnailUrl'>
  </a>
</div>

Altri suggerimenti

Maybe someone finds this question while searching for "how to use Schema.org ImageObject", as I did, so, just for reference, here is an example from the Schema.org documentation:

Without markup:

<h2>Beach in Mexico</h2>
<img src="mexico-beach.jpg" alt="Sunny, sandy beach."/>
By Jane Doe
Photographed in Puerto Vallarta, Mexico
Date uploaded: Jan 25, 2008
I took this picture while on vacation last year.

Microdata:

<div itemscope itemtype="http://schema.org/ImageObject">
  <h2 itemprop="name">Beach in Mexico</h2>
  <img src="mexico-beach.jpg"
  alt="Sunny, sandy beach."
  itemprop="contentUrl" />
  By <span itemprop="author">Jane Doe</span>
  Photographed in
    <span itemprop="contentLocation">Puerto Vallarta, Mexico</span>
  Date uploaded:
    <meta itemprop="datePublished" content="2008-01-25">Jan 25, 2008
  <span itemprop="description">I took this picture while on vacation last year.</span>
</div>

http://schema.org/ImageObject#examples

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top