在 JSON-LD 中创建产品数组
Creating an array of products in JSON-LD
有人能看出我下面的代码有什么问题吗? (它不会在 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>
非常感谢任何帮助!
您在某些地方使用 “
而不是 "
。
替换这些,您的代码段验证:
<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>
更新: 此代码段未使用 Google Rich Results Test anymore. Schema is being actively developed, so sometimes the requirements change after a while. For a list of products, Google is suggesting so called carousel.
进行验证
有人能看出我下面的代码有什么问题吗? (它不会在 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>
非常感谢任何帮助!
您在某些地方使用 “
而不是 "
。
替换这些,您的代码段验证:
<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>
更新: 此代码段未使用 Google Rich Results Test anymore. Schema is being actively developed, so sometimes the requirements change after a while. For a list of products, Google is suggesting so called carousel.
进行验证