可以在同一页面中使用多个
JSON-LD组(使用Schema.org)吗?
如果我不能,怎么把它们结合在一起?我不太熟悉语法.
第1组:
<script type="application/ld+json"> { "@context": "http://schema.org","@type": "LocalBusiness","address": { "@type": "PostalAddress","streetAddress": "3102 Highway 98","addressRegion": "FL","addressLocality": "Mexico Beach","postalCode": "45252","addressCountry": "US",},"geo": { "@type": "GeoCoordinates","latitude": "40.75","longitude": "73.98" },"name": "Beachwalk Beachwear & Giftware","telephone": "850-648-4200","email": "admin@example.com","faxNumber": "860-562-4250",} </script>
第2组:
<script type="application/ld+json"> { "@context": "http://schema.org","@type": "Organization","url": "http://example.com","name": "My Domain Title","logo": "http://example.com/wp-content/uploads/2015/08/abc.jpg","contactPoint": [ { "@type": "ContactPoint","telephone": "0192-39192130","contactType": "customer service" },{ "@type": "ContactPoint","telephone": "0182-239120398","contactType": "customer service" } ],"sameAs": [ "http://facebook.com/myfbaccount","http://twitter.com/mytwitteraccount" ] } </script>
解决方法
您可以在页面上拥有多个脚本块,也可以将其组合到单个块中.将它们组合成单个块的最简单方法是使用@graph关键字,如下所示:
<script type="application/ld+json"> { "@graph": [ { ... your first JSON-LD block ... },{ ... your second JSON-LD block ... } ] } </script>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。