Domanda

Ho iniziato a usare schemi da schema.org Nel mio codice HTML e ho preparato una galleria di immagini (snippet di seguito). Quando ho incollato il mio codice in Strumento di test dei dati strutturati di Google, Non ho ricevuto errori, quindi ho pensato che l'uso di questi schemi fosse corretto, ma sono ancora se lo è. È?

<figure itemscope itemtype="http://schema.org/ImageGallery">
  <figcaption itemprop="description">The castle through the ages: 1423, 1858, and 1999 respectively.</figcaption>
  <figure itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
    <figcaption itemprop="caption">Etching. Anonymous, ca. 1423.</figcaption>
    <a href="castle1423.jpeg" itemprop="contentURL"> <img src="castle1423_thumb.jpeg" alt="The castle has one tower, and a tall wall around it." itemprop="thumbnailUrl"> </a> </figure>
  <figure itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
    <figcaption itemprop="caption">Oil-based paint on canvas. Maria Towle, 1858.</figcaption>
    <a href="castle185.jpeg" itemprop="contentURL"> <img src="castle1858_thumb.jpeg" alt="The castle now has two towers and two walls." itemprop="thumbnailUrl"> </a> </figure>
  <figure itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
    <figcaption itemprop="caption">Film photograph. Peter Jankle, 1999.</figcaption>
    <a href="castle1999.jpeg" itemprop="contentURL"> <img src="castle1999_thumb.jpeg" alt="The castle lies in ruins, the original tower all that remains in one piece." itemprop="thumbnailUrl"> </a> </figure>
</figure>
È stato utile?

Soluzione

Il image proprietà di ImageGallery a) si aspetta un URL e B) è definito come:

URL di un'immagine dell'oggetto.

Quindi il tuo markup dice: "La mia ImageGallery può essere descritta da tre immagini."; Anche se probabilmente dovrebbe dire:"Il mio imagegallery è composto da tre immagini.".

Quindi con image È possibile specificare un'immagine che può essere utilizzata per rappresentare l'intera galleria.

Per ogni immagine della galleria dovresti probabilmente usare il associatedMedia proprietà (Ma non sono sicuro al 100% se ottengo la sua definizione correttamente, "codifica" mi confonde qui).

Il markup per ciascuno ImageObject mi sembra buono.

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