【问题标题】:Creating an array of products in JSON-LD在 JSON-LD 中创建产品数组
【发布时间】:2015-10-22 02:53:55
【问题描述】:

有人能发现我下面的代码有什么问题吗? (它在 Google 结构化测试工具中无效。)我正在尝试创建 JSON-LD 代码以添加到包含多种待售产品的页面。

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@graph": [
{
  "@type": “Product”,
  "name": “tshirt",
  “description”: "test copy 1.”,
  “image”: “image.jpg”
},
{
  "@type": “Product”,
  "name": “tshirt 2",
  “description”: "test copy 2.”,
  “image”: “image2.jpg”
}
]
}
</script>

非常感谢任何帮助!

【问题讨论】:

    标签: seo json-ld structured-data


    【解决方案1】:

    您在某些地方使用 而不是"

    替换这些,您的 sn-p 验证:

    <script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@graph": [
    {
      "@type": "Product",
      "name": "tshirt",
      "description": "test copy 1.",
      "image": "image.jpg"
    },
    {
      "@type": "Product",
      "name": "tshirt 2",
      "description": "test copy 2.",
      "image": "image2.jpg"
    }
    ]
    }
    </script>
    

    更新:此 sn-p 不再使用 Google Rich Results Test 进行验证。 Schema 正在积极开发中,因此有时需求会在一段时间后发生变化。对于产品列表,Google 建议使用所谓的carousel

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-20
      • 1970-01-01
      • 1970-01-01
      • 2019-06-24
      • 2023-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多