Reputation: 930
I am implementing Schema.org structured data into my magazine-style website and have a couple of concerns regarding the use of multiple lists.
I have two sections on my home page: 'Most Recent' and 'Most Popular'. Both sections contain five mini-articles each. I have considered both of these sections as 'lists'. This is an example of one section - the other is identical apart from the articles, obviously:
This is my Schema JSON-LD. I have cut this sample short at ...
for the sake of keeping the sample easily readable and have removed domains/names, etc. So far, I have only added the five articles from 'Most Recent' to this ItemList
and testing it using Google's Structured Data Testing Tool returns zero warnings and zero errors:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ItemList",
"numberOfItems": "5",
"itemListOrder": "Descending",
"itemListElement": [
{
"@type": "Article",
"position": "1",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "/motoring/audi-launches-2019-sq8-tdi/"
},
"articleSection": "Motoring",
"headline": "Audi launches 2019 SQ8 TDI",
"datePublished": "2019-09-01",
"dateModified": "2019-09-01",
"image": "/content/uploads/2019/08/2019-audi-sq8-tdi-001-800.jpg",
"url": "/motoring/audi-launches-2019-sq8-tdi/",
"author": "The Author",
"publisher": {
"@type": "Organization",
"name": "Company Name",
"url": "https://company.name",
"logo": {
"@type": "ImageObject",
"url": "https://company.name/logo.png"
},
"founder": "Founder",
"foundingDate": "2019"
}
},
{
"@type": "Article",
"position": "2",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "/gadgets-tech/meet-keysmart-the-smart-key-oraganiser/"
},
"articleSection": "Gadgets & Tech",
"headline": "Meet Keysmart: The smart key organiser",
"datePublished": "2019-09-01",
"dateModified": "2019-09-01",
"image": "/content/uploads/2019/08/the-smartkey-orgainser-001-800.jpg",
"url": "/gadgets-tech/meet-keysmart-the-smart-key-oraganiser/",
"author": "The Author",
"publisher": {
"@type": "Organization",
"name": "Company Name",
"url": "https://company.name",
"logo": {
"@type": "ImageObject",
"url": "https://company.name/logo.png"
},
"founder": "Founder",
"foundingDate": "2019"
}
},
...
]
}
</script>
However, as mentioned above, this ItemList
is only for the five 'Most Recent' articles. I would now like to add structured data for the other section, 'Most Popular', and not sure how best to approach it.
ItemList
, do I
create a new ItemList
or do I create a new script/JSON? How is
this best achieved? Please provide an example.mainEntityOfPage
. Am I right using type 'WebPage' or should I be
using type 'Article'?Upvotes: 1
Views: 2701
Reputation: 7741
In general use HTML5 semantic element (main, section and so on) + Correct site outliner (H2 for each list and so on).
About your schema. The best idea is to think in "microdata" view.
Your list is not nested
<ul>
<li>
<ul><li></li></ul>
</li>
<li>
<ul><li></li></ul>
</li>
</ul>
Nested lists example: https://schema.org/OfferCatalog#offer-3
In this case, I think the best/simple idea is to use two seperate lists "objects" (And add name/url/and so on for each list) - Example outline (Missing properties for short code):
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ItemList",
"name": "Recent Articles",
"numberOfItems": "1",
"itemListOrder": "Descending",
"itemListElement": [
{
"@type": "Article",
"position": "1",
"headline": "I am recent Article"
}
]
}
</script>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ItemList",
"name": "Popular Articles",
"numberOfItems": "1",
"itemListOrder": "Descending",
"itemListElement": [
{
"@type": "Article",
"position": "1",
"headline": "I am Popular Article"
}
]
}
</script>
Try this idea:
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/itemref
https://moz.com/blog/search-marketers-guide-to-itemref-itemid
Example (Refernce Organization object to Article):
<!-- Organization -->
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"@id": "#Organization-name",
"name": "My Organization"
}
</script>
<!-- Recent Articles -->
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ItemList",
"name": "Recent Articles",
"numberOfItems": "1",
"itemListOrder": "Descending",
"itemListElement": [
{
"@type": "Article",
"position": "1",
"headline": "I am recent Article",
"publisher": {
"@id": "#Organization-name"
}
}
]
}
</script>
<!-- Popular Articles -->
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ItemList",
"name": "Popular Articles",
"numberOfItems": "1",
"itemListOrder": "Descending",
"itemListElement": [
{
"@type": "Article",
"position": "1",
"headline": "I am Popular Article",
"publisher": {
"@id": "#Organization-name"
}
}
]
}
</script>
Upvotes: 3