gpt4 book ai didi

xhtml - 在 xhtml 页面中使用 schema.org 标记和评论时,不显示星级和聚合评分

转载 作者:行者123 更新时间:2023-12-03 21:40:48 27 4
gpt4 key购买 nike

我正在尝试在我的 xhtml 模板中实现 schema.org 的 microData 格式。
由于我使用的是 xhtml 模板,因此我需要添加

<div itemprop="reviews" itemscope="itemscope" itemtype="http://schema.org/Review">

代替:
<div itemprop="reviews" itemscope itemtype="http://schema.org/Review">

否则我的模板不会被解析。我找到了解决方案 here

我的标记如下所示:
<div itemscope="itemscope" itemtype="http://schema.org/Place">

<div itemprop="aggregateRating" itemscope="itemscope"
itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue">#{company.meanRating}</span> stars -
based on <span itemprop="reviewCount">#{company.confirmedReviewCount}</span> reviews
</div>

<ui:repeat var="review" value="#{company.reverseConfirmedReviews}">

<div itemprop="reviews" itemscope="itemscope" itemtype="http://schema.org/Review">
<span itemprop="name">Not a happy camper</span> -
by <span itemprop="author">#{review.reviewer.firstName}</span>,
<div itemprop="reviewRating" itemscope="itemscope" itemtype="http://schema.org/Rating">
<span itemprop="ratingValue">1</span>/
<span itemprop="bestRating">5</span>stars
</div>
<span itemprop="description">#{review.text} </span>
</div>

</ui:repeat>
</div>

http://www.google.com/webmasters/tools/richsnippets 中测试时我没有得到任何星星或汇总的评论数

我在这里做错了什么?

最佳答案

是的!!
问题实际上包含两个错误,首先有人将 div 类命名为
hReview-aggregate ”适用于实现 微格式 不是
微数据

第二个错误是我误解了 schema.org 的规范。
这就是我最终做的:

           <div class="box bigBox" itemscope="itemscope" itemtype="http://schema.org/LocalBusiness">
<span itemprop="name">#{viewCompany.name}</span>
<div class="subLeftColumn" style="margin-top:10px;" itemprop="aggregateRating" itemscope="itemscope" itemtype="http://schema.org/AggregateRating">
<div class="num">
<span class="rating" id="companyRating" itemprop="ratingValue">#{rating}</span>
</div>
<div>Grade</div>
<div class="num">
<span class="count" id="companyCount" itemprop="reviewCount">
#{confirmedReviewCount}
</span>
</div>
</div>
</div>

希望这可以帮助!!!!!

关于xhtml - 在 xhtml 页面中使用 schema.org 标记和评论时,不显示星级和聚合评分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8244195/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com