Mobile app version of vmapp.org
Login or Join
Vandalay111

: Schema.org - Microdata and JSON-LD behave diffrently for same code Having a hard time with JSON-DL and several blogPost. The way I see it, both Microdata one and JSON-DL one is exactly the

@Vandalay111

Posted in: #Html5 #JsonLd #Microdata #SchemaOrg

Having a hard time with JSON-DL and several blogPost. The way I see it, both Microdata one and JSON-DL one is exactly the same, yet the latter only show one blogPost, where Microdata show both.

HTML Microdata Markup:

<body itemscope itemtype="https://schema.org/Blog">
<header>...</header>
<article itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting">
<h1 itemprop="headline">Article Heading One</h1>
</article>
<article itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting">
<h1 itemprop="headline">Article Heading Two</h1>
</article>
</body>


JSON-DL Markup:

<script type="application/ld+json">
{
"@context":"http://schema.org",
"@type":"Blog",
"blogPost":{
"@type":"blogPosting",
"headline":"Article Heading One"
},
"blogPost":{
"@type":"blogPosting",
"headline":"Article Heading Two"
}
}
</script>


Copy here to test: search.google.com/structured-data/testing-tool/u/0/
Anyone see whats wrong?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Vandalay111

1 Comments

Sorted by latest first Latest Oldest Best

 

@Lengel546

Typcal... Tried several different methods for hours, and a few minutes after I ask here, I fix it myself...

Anyway, correct code for getting several blogPosts is this:

<script type="application/ld+json">
{
"@context":"http://schema.org",
"@type":"Blog",
"blogPosts":
[
{
"@type":"blogPosting",
"headline":"Article Heading One"
},
{
"@type":"blogPosting",
"headline":"Article Heading Two"
}
]
}
</script>


Will use it to markup every blog like a index site, guess that is what Its for :)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme