Hi,
Zitat von
Gruematz
Hallo,
gibt es mittlerweile ein funktionierendes Template um die Bewertungen als Rich snippets bei Google nach schema.org sichtbar zu machen? Oder kann jemand das vorhandene Template anpassen?
Viele Grüße
ich habe das nicht getestet, aber für einen Artikel könnte das u.U. so Aussehen:
HTML-Code:
<div itemscope itemtype="http://schema.org/Article">
<?php if ($this->rateit_rating_before): ?>
<!-- indexer::stop -->
<div id="<?php echo $this->rateItID; ?>" class="<?php echo $this->class; ?> <?php echo $this->rateit_class; ?>">
<?php if ($this->showBefore) : ?>
<div id="<?php echo $this->descriptionId; ?>" class="ratingText"><?php echo $this->description; ?></div>
<?php endif; ?>
<div class="wrapper">
<div class="rateItRating-selected" style="display: block;"></div>
<div class="rateItRating-hover"></div>
</div>
<?php if ($this->showAfter) : ?>
<div id="<?php echo $this->descriptionId; ?>" class="ratingText"><?php echo $this->description; ?></div>
<?php endif; ?>
</div>
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<span class="rating-microdata" itemprop="name"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemprop="ratingValue"><?php echo $this->actRating; ?></span>
<span class="rating-microdata" itemprop="bestRating"><?php echo $this->maxRating; ?></span>
<span class="rating-microdata" itemprop="worstRating">1</span>
<span class="rating-microdata" itemprop="ratingCount"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>
<div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<?php if ($this->printable): ?>
<!-- indexer::stop -->
<div class="pdf_link">
<?php if ($this->printButton): ?>
<a href="<?php echo $this->print; ?>" rel="nofollow" title="<?php echo $this->printTitle; ?>" onclick="window.print();return false"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/print.gif" width="16" height="16" alt=""></a>
<?php endif; ?>
<?php if ($this->pdfButton): ?>
<a href="<?php echo $this->href; ?>" rel="nofollow" title="<?php echo $this->pdfTitle; ?>"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/pdf.gif" width="16" height="16" alt=""></a>
<?php endif; ?>
<?php if ($this->facebookButton): ?>
<a href="share/?p=facebook[&]u=<?php echo $this->encUrl; ?>[&]t=<?php echo $this->encTitle; ?>" rel="nofollow" title="<?php echo $this->facebookTitle; ?>" onclick="window.open(this.href,'','width=640,height=380,modal=yes,left=100,top=50,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');return false"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/facebook.gif" width="24" height="24" alt=""></a>
<?php endif; ?>
<?php if ($this->twitterButton): ?>
<a href="share/?p=twitter[&]u=<?php echo $this->encUrl; ?>[&]t=<?php echo $this->encTitle; ?>" rel="nofollow" title="<?php echo $this->twitterTitle; ?>" onclick="window.open(this.href,'','width=640,height=380,modal=yes,left=100,top=50,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');return false"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/twitter.gif" width="24" height="24" alt=""></a>
<?php endif; ?>
<?php if ($this->gplusButton): ?>
<a href="share/?p=gplus[&]u=<?php echo $this->encUrl; ?>[&]t=<?php echo $this->encTitle; ?>" rel="nofollow" title="<?php echo $this->gplusTitle; ?>" onclick="window.open(this.href,'','width=600,height=200,modal=yes,left=100,top=50,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');return false"><img src="<?php echo TL_FILES_URL; ?>assets/contao/images/gplus.gif" width="24" height="24" alt=""></a>
<?php endif; ?>
</div>
<!-- indexer::continue -->
<?php endif; ?>
<?php echo implode($this->elements); ?>
<?php if ($this->backlink): ?>
<!-- indexer::stop -->
<p class="back"><a href="<?php echo $this->backlink; ?>" title="<?php echo $this->back; ?>"><?php echo $this->back; ?></a></p>
<!-- indexer::continue -->
<?php endif; ?>
</div>
<?php if ($this->rateit_rating_after): ?>
<!-- indexer::stop -->
<div id="<?php echo $this->rateItID; ?>" class="<?php echo $this->class; ?> <?php echo $this->rateit_class; ?>">
<?php if ($this->showBefore) : ?>
<div id="<?php echo $this->descriptionId; ?>" class="ratingText"><?php echo $this->description; ?></div>
<?php endif; ?>
<div class="wrapper">
<div class="rateItRating-selected" style="display: block;"></div>
<div class="rateItRating-hover"></div>
</div>
<?php if ($this->showAfter) : ?>
<div id="<?php echo $this->descriptionId; ?>" class="ratingText"><?php echo $this->description; ?></div>
<?php endif; ?>
</div>
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<span class="rating-microdata" itemprop="name"><?php echo $this->itemreviewed; ?></span>
<span class="rating-microdata" itemprop="ratingValue"><?php echo $this->actRating; ?></span>
<span class="rating-microdata" itemprop="bestRating"><?php echo $this->maxRating; ?></span>
<span class="rating-microdata" itemprop="worstRating">1</span>
<span class="rating-microdata" itemprop="ratingCount"><?php echo $this->votes; ?></span>
</div>
<!-- indexer::continue -->
<?php endif; ?>
</div>
Lesezeichen