8

If I have a category page that has a list of links to the specific items, this page would be a CollectionPage with significantLinks, right?

I thought this would be the correct basic implementation:

{
  "@context": "http://schema.org",
  "@type": "WebPage",
  "url": "http://example.com/animals",
  "mainEntity":{
    "@type": "CollectionPage",
    "significantLinks": [
      "http://example.com/animals/dog",
      "http://example.com/animals/cat"
    ]
  }
}

But this feels like it's missing something (labels, for example). I also saw the hasPart property which seems like it should be used in a page like this, but using both hasPart and significantLinks feels very disconnected.

Thoughts?

1 Answer 1

8

You should use CollectionPage instead of WebPage, not in addition to it. CollectionPage is a more specific WebPage.


It seems that significantLink (for URL values) as well as hasPart (for CreativeWork values) could be used. But I think hasPart is the better choice here, because significantLink could also be used for pages that don’t belong to the category (so for consumers it’s not necessarily clear that these are category items), and hasPart would allow you to provide metadata (in case you want to display it on the category page).

{
  "@context": "http://schema.org",
  "@type": "CollectionPage",
  "hasPart": [
    {
      "@type": "ItemPage"
    },
    {
      "@type": "ItemPage"
    },
    {
      "@type": "ItemPage"
    }
  ]
}

Another option is to use mainEntity to reference an ItemList. It conveys that the list is the primary entity of the CollectionPage, so for consumers it’s probably clear that this is the collection the page is about.

{
  "@context": "http://schema.org",
  "@type": "CollectionPage",
  "mainEntity": {
    "@type": "ItemList",
    "itemListElement": [
      {
        "@type": "ItemPage"
      },
      {
        "@type": "ItemPage"
      },
      {
        "@type": "ItemPage"
      }
    ]
  }
}
7
  • So can/should I use hasPart as well as ItemList? Aug 22, 2016 at 12:20
  • @JohnRPerry: I think it’s not necessary. I would only use hasPart if you can’t (or don’t want to) use mainEntity ItemList.
    – unor
    Aug 22, 2016 at 12:48
  • It would be great if you provide html example of CollectionPage + ItemList of WebPage items. Jun 3, 2018 at 7:04
  • @ilyaigpetrov: I added two plain examples. If you have a question that goes further than that: you can ask on Stack Overflow if the question is about the syntax/rules (not about SEO), you can ask on Webmasters if the question is about the vocabulary/SEO, and you can ask on Code Review if you want a review of your solution.
    – unor
    Jun 3, 2018 at 9:11
  • 1
    @EthanCollins: No, they convey different things. First of all, hasPart expects a CreativeWork value, while mainEntity expects any Thing (if you have a page about a person, it’s not possible (and doesn’t make sense) to say <WebPage hasPart Person>). But the primary difference is that many things can be part of a creative work, but not all of these things are necessarily the main*/*primary things on this page.
    – unor
    Jun 11, 2019 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.