Reputation: 173
I want to build JSON-LD for my homepage. In my page I have:
I try build the JSON-LD like this:
<script type="application/ld+json">
[
{
"@context": "http://schema.org",
"@type": "WebSite",
.
.
.
},
{
"@context": "http://schema.org",
"@type": "WebPage",
"mainEntity":{
"@type": "ItemList",
"itemListElement":[
{
"@type": "BlogPosting",
.
.// 4- one list of main items
.
}
...
]
}
.
.
.
}]
</script>
If my structure is true,
how can I add SiteNavigationElement
and sidebar content to this JSON object? Do I have to add another object or I can insert it in WebPage
?
I use JSON-LD. Do I need to use Microdata too? or is JSON-LD enough?
I create a full sitemap-index.xml for all menu and items. Do I really need to add SiteNavigationElement
(and another thing except mainEntity
) in JSON-LD?
Upvotes: 1
Views: 1837
Reputation: 96697
(Everything you can do with Microdata can also be done with JSON-LD, and vice versa. So there is no need to mix. There might be consumers that support only one syntax for certain features, though.)
You can add SiteNavigationElement
with the hasPart
property to the WebPage
:
{
"@context": "http://schema.org",
"@type": "WebPage",
"hasPart":
{
"@type": "SiteNavigationElement"
}
}
But using SiteNavigationElement
(and the other WebPageElement
types) is typically not useful, so you might want to consider omitting it.
Upvotes: 1