I am trying to use Microdata to define my website using the Schema.org definitions.
Below is my current HTML markup:
<body itemscope itemtype="http://schema.org/ItemPage">
<link itemprop="url" href="https://example.com/i/10" />
<main role="main">
<!-- Show the main product of the page -->
<div itemprop="mainEntity" itemtype="http://schema.org/Product" itemscope>
<meta itemprop="name" content="My Main Product 10 Name" />
<!-- ... more properties that describes current product -->
</div>
<!-- List of 10 similar product the current product being viewed -->
<div class="list-related-products">
<div itemtype="http://schema.org/Product" itemscope>
<meta itemprop="name" content="Related Product 20 Name" />
<meta itemprop="url" content="https://example.com/i/20" />
<div itemprop="isSimilarTo" itemscope itemtype="http://schema.org/Product">
<link itemprop="url" href="https://example.com/i/10" />
</div>
<!-- ... more properties -->
</div>
<!-- ... more products -->
</div>
</main>
</body>
When I validate the code using Structured Data Testing Tool, the similar products section shows up as a separate nodes and not part of the ItemPage
.
How can I list the related similar products correctly under the current product being defined?