contao / contao

Contao Open Source CMS
https://contao.org
GNU Lesser General Public License v3.0
347 stars 158 forks source link

in breadcrump-template fehlendes microdata position meta #3128

Closed srhinow closed 3 years ago

srhinow commented 3 years ago

in Contao 4.9 ist es so das das aktuelle Breadcrumb-template nicht die Prüfung auf https://search.google.com/test/rich-results?utm_campaign=devsite&utm_medium=microdata&utm_source=breadcrumb besteht da eine Zeile in jedem Item fehlt: (https://developers.google.com/search/docs/data-types/breadcrumb#microdata) das kann man zwar nachrüsten aber ein von-Haus-aus wäre nett.

<?php $this->extend('block_unsearchable'); ?>

<?php $this->block('content'); ?>
<div class="container">
  <ul itemprop="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList">
    <?php 
    $i = 0;
    foreach ($this->items as $item): 
    $i++;
    ?>
      <?php if ($item['isActive']): ?>
        <li class="active<?php if ($item['class']): ?> <?= $item['class'] ?><?php endif; ?> last" itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement"><strong itemprop="name"><?= $item['link'] ?></strong><meta itemprop="position" content="<?=$i?>" /></li>
      <?php else: ?>
        <?php if(strpos($item['class'],'first') !== false):?>
            <li<?php if ($item['class']): ?> class="<?= $item['class'] ?>"<?php endif; ?> itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement"><a href="<?= $item['href'] ?>" title="<?= $item['title'] ?>" itemprop="item"><span itemprop="name"><?=$item['title']?></span></a><meta itemprop="position" content="<?=$i?>" /></li>
        <?php else: ?>
            <li<?php if ($item['class']): ?> class="<?= $item['class'] ?>"<?php endif; ?> itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement"><a href="<?= $item['href'] ?>" title="<?= $item['title'] ?>" itemprop="item"><span itemprop="name"><?= $item['link'] ?></span></a><meta itemprop="position" content="<?=$i?>" /></li>
        <?php endif; ?>
      <?php endif; ?>
    <?php endforeach; ?>
  </ul>
</div>
<?php $this->endblock(); ?>
fritzmg commented 3 years ago

What exactly is missing?

srhinow commented 3 years ago

grafik content="[itemCounter]"

srhinow commented 3 years ago

mmm ok dann hatte ich ein veraltetes Template wo die content-Passage gefehlt hat: https://github.com/srhinow/contao/commit/23f005a8e7b964b155bc907b008eb9716e403df7#diff-deb9049ccb8bda1b926bb00acc5335010aa4d912bd76c31528168cb079b65b82