How do I have an itemprop nested in one itemscope actually be applied to a different itemscope?

落花浮王杯 提交于 2019-11-28 12:50:17

Assuming you mean you want it only attached to the Product, as per your penultimate paragraph, and not only attached the aggregateRating as per per your last paragraph, then the best I can come up is

<div itemscope itemtype="http://schema.org/Product" itemref="productMicrodata">
  <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
    <span itemprop="ratingValue">79</span>
    <h1 itemscope><span itemprop="name" id="productMicrodata">Someproductsoandso</span></h1>
    <span itemprop="reviewCount">830</span>
  </div>
</div>

The itemscope on the h1 hides the h1's children from the aggregateRating item, so the name property will only be attached to the Product item via the productMicrodata itemref. It does however, create a third item which has no type.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!