I'm trying to use the SiteNavigationElement
type from Schema.org. The HTML is generated dynamically so I can't edit it. So JSON-LD is my only option.
I want all navigation elements under a single SiteNavigationElement
object.
I have attached the desired output as screenshot:
Schema.org’s
SiteNavigationElement
type cannot be used for the navigation links, only for the whole navigation.So the
url
would be the URL for the navigation (it typically doesn’t have one) and thename
would be the name of the navigation (e.g., "Navigation" or "Main menu" etc.).The type
SiteNavigationElement
(as well as the parentWebPageElement
type and its other sub-types) is not really useful for typical web pages.Here's how to do it:
This code will come out like as seen in this example.