我在https://search.google.com/structured-data/testing-tool/u/0/上面临此ListItem架构验证的问题 得到错误
为网址提供的所有值必须具有相同的域。
我在每个网址字段中提供了相同的域名。
{
"@context": "http://schema.org",
"@type": "ItemList",
"name": "Tech News",
"url": "http://m.gadgetsnow.com/tech-news",
"itemListElement": [
{
"@type": "ListItem",
"position": "1",
"url": "http://m.gadgetsnow.com/tech-news/are-tvs-going-out-of-fashion/articleshow/58375579.cms",
"name": "Are TVs going out of fashion?",
"image": {
"@type": "ImageObject",
"contentUrl": "http://m.gadgetsnow.com/photo/58375579.cms",
"width": "360",
"height": "270",
"url": "http://m.gadgetsnow.com/photo/58375579.cms"
}
},
{
"@type": "ListItem",
"position": "2",
"url": "http://m.gadgetsnow.com/tech-news/reliance-jio-discounts-are-not-going-anywhere-for-now-heres-why/articleshow/58374335.cms",
"name": "Reliance Jio discounts are not going anywhere for now, here's why",
"image": {
"@type": "ImageObject",
"contentUrl": "http://m.gadgetsnow.com/photo/58374335.cms",
"width": "360",
"height": "270",
"url": "http://m.gadgetsnow.com/photo/58374335.cms"
}
}
]
}
答案 0 :(得分:1)
您可以尝试使用ItemList
的正确版本。 Separately
和Combined
标记ItemLists
为here。
- 如果您的商品位于同一页面上,请使用内置商品的版本,即合并商品。
- 否则,如果您指向内部的不同页面并且您的项目不在一个页面上,请不要将项目元素与类型和其他 里面的描述,单独标记了一个。
其他参考资料:
答案 1 :(得分:0)
没有错误。如果validator出现错误,请多加注意,丰富的摘要无法正常运行。
那是什么问题?首先要注意的是,在ListItem对象中,可以使用url或item。正如schema.org文档所述,item
用于:
艺术家的数据艺术家列表(例如“艺术家”列表中的“艺术家”)
最重要的一点是:如果您使用item
并且希望方案正确,那么在所有ListItem中域及其部分都应该相同,但是锚点是不同的,即使用#
符号与网址分隔。 Google给出了specific example:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "ItemList",
"itemListElement": [
{
"@type": "ListItem",
"position": "1",
"item": {
"@context": "https://schema.org/",
"@type": "Recipe",
"url": "http://example.com/big_list_of_recipes#cherry_pie",
}
},
{
"@type": "ListItem",
"position": "2",
"item": {
"@context": "https://schema.org/",
"@type": "Recipe",
"url": "http://example.com/big_list_of_recipes#coffee_cake",
...
}
}
]
}
</script>
正如您在列表中所看到的,使用了相同的URL <script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "ItemList",
"itemListElement": [
{
"@type": "ListItem",
"position": "1",
"item": {
"@context": "https://schema.org/",
"@type": "Recipe",
"url": "http://example.com/big_list_of_recipes#cherry_pie",
}
},
{
"@type": "ListItem",
"position": "2",
"item": {
"@context": "https://schema.org/",
"@type": "Recipe",
"url": "http://example.com/big_list_of_recipes#coffee_cake",
...
}
}
]
}
</script>
,但是使用了不同的锚点:http://example.com/big_list_of_recipe
和#cherry_pie
。
但是仍然不清楚如何指定URL,URL是事物的单独页面。