首页 > 解决方案 > 第二页和连续页的类别页面json-ld模式?

问题描述

我们有一个分页的类别页面。我们不清楚如何处理分页中的模式,尤其是对于第二页和后续页面。

下面是我们目前定义的。第一CollectionPage架构:

{
    "@context":"http://schema.org",
    "@type":"CollectionPage",
    "@id":"https://www.example.com/cat?pg=1",
    "url":"https://www.example.com/cat?pg=1",
    "breadcrumb":{...},
}

而且,第一页的ItemList架构:

{
    "@context":"https://schema.org",
    "@type":"ItemList",
    "@id":"https://www.example.com/cat?pg=1#cat-page",  // 1st pg URL, with hash URI
    "url":"https://www.example.com/cat?pg=1",           // 1st pg URL
    "name":"Running Shoes",
    "numberOfItems":"490",
    "mainEntityOfPage":"https://www.example.com/cat?pg=1", // 1st pg URL
    "itemListElement":[
        {
            "@type":"ListItem",
            "position":"1",
            "url":"..."
        },{
            ...
        },{
            "@type":"ListItem",
            "position":"50",      // 50 items per page
            "url":"..."
        }
    ]
}

在第 2 页和后续页面上,我们只有一个ItemList,如下所示:

{
    "@context":"https://schema.org",
    "@type":"ItemList",
    "@id":"https://www.example.com/cat?pg=1#cat-page",  // 1st pg URL, with hash URI
    "url":"https://www.example.com/cat?pg=1",           // 1st pg URL
    "name":"Running Shoes",
    "numberOfItems":"490",
    "mainEntityOfPage":"https://www.example.com/cat?pg=1", // 1st pg URL (CollectionPage there)
    "itemListElement":[
        {
            "@type":"ListItem",
            "position":"51",
            "url":"..."
        },{
            ...
        },{
            "@type":"ListItem",
            "position":"100",      // 50 items per page
            "url":"..."
        }
    ]
}

注意第二页ItemList有它@idurl并且mainEntityOfPage都使用第一页的 URL,第二页的 URL 没有使用。itemListElement与第一页声明相比,只有数组发生了变化。

Google(第 1 点,最后一张图)对于 HTML 数据,它会整理分页列表并构建单页摘要。对于模式,ItemListnumberOfItems定义为保存跨页面的项目总数。因此,它希望消费者将ItemList. 尽管 HTML 和 Schema 是不同的实体,但我假设像 Google 和其他人这样的消费者将处理分页模式 ItemList。

但是,不清楚的是如何声明@id,urlmainEntityOfPage分页的ItemList. 我将它们设置为指向它在第一页上的第一个实例。

查询是:这是为分页类别页面执行模式的正确方法吗?或者,我们缺少一些东西或者可能是更好的方法?

标签: schema.orgjson-ldgoogle-rich-snippets

解决方案


推荐阅读