2015-05-28 41 views

回答

11

如果你有多個項目作爲屬性的值,你可以使用一個array

<script type="application/ld+json"> 
{ 
    "@context": "http://schema.org", 
    "@type": "WebPage", 
    "video": 
    [ 
    { 
     "@type": "VideoObject" 
    }, 
    { 
     "@type": "VideoObject" 
    } 
    ] 
} 
</script> 

如果您對頂級多個項目(而不是作爲一個屬性的值),您可以使用(named) graph和數組:

<script type="application/ld+json"> 
{ 
    "@context": "http://schema.org", 
    "@graph": 
    [ 
    { 
     "@type": "VideoObject" 
    }, 
    { 
     "@type": "VideoObject" 
    } 
    ] 
} 
</script> 

當然,你可以使用multiple script elements

<script type="application/ld+json"> 
{ 
    "@context": "http://schema.org", 
    "@type": "WebPage", 
    "video": 
    { 
    "@type": "VideoObject" 
    } 
} 
</script> 

<script type="application/ld+json"> 
{ 
    "@context": "http://schema.org", 
    "@type": "WebPage", 
    "video": 
    { 
    "@type": "VideoObject" 
    } 
} 
</script> 
+0

(請注意,這僅僅是示例代碼,並非針對您的具體情況而定製的。如果你想知道你應該使用哪些Schema.org類型和屬性,這應該是一個單獨的問題。) – unor