ANDA
ANDA

Reputation: 173

How can I add SiteNavigationElement and footer into JSON-LD?

I want to build JSON-LD for my homepage. In my page I have:

  1. header
  2. navigation (2 series)
  3. sidebar (with 2 list of items)
  4. one list of main items
  5. footer

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,

  1. 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?

  2. I use JSON-LD. Do I need to use Microdata too? or is JSON-LD enough?

  3. 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

Answers (1)

unor
unor

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

Related Questions