Jump to content

Как разметить хлебные крошки в соответствии с новыми стандартами?


В файле catalog/view/theme/coloring/template/product/product.tpl найдите код

<ul class="breadcrumb" prefix:v="http://rdf.data-vocabulary.org/#">
  <?php $breadcount = count($breadcrumbs) - 1; ?>
  <?php $i = 0; ?>
  <?php foreach ($breadcrumbs as $key => $breadcrumb) { ?>
  <?php $i++; ?>
  <?php if ($key != $breadcount) { ?>
  <li <?php if ($i > 1) { echo 'typeof="v:Breadcrumb"'; } ?>><a href="<?php echo $breadcrumb['href']; ?>" <?php if ($i > 1) { echo 'rel="v:url" property="v:title"'; } ?>><?php echo $breadcrumb['text']; ?></a></li>
  <?php } else {?>
  <li class="active"><?php echo $breadcrumb['text']; ?></li>
  <?php } ?>
  <?php } ?>
</ul>

и замените его  на 

<ul class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList">
  <?php $breadcount = count($breadcrumbs) - 1; ?>
  <?php foreach ($breadcrumbs as $key => $breadcrumb) { ?>
  <?php if ($key == 0) { ?>
  <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
    <a href="<?php echo $breadcrumb['href']; ?>" itemprop="item">
      <meta itemprop="name" content="Home" />
      <?php echo $breadcrumb['text']; ?>
    </a>
    <meta itemprop="position" content="<?php echo $key; ?>" />
  </li>
  <?php } elseif ($key != $breadcount) { ?>
  <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
    <a href="<?php echo $breadcrumb['href']; ?>" itemprop="item">
      <span itemprop="name"><?php echo $breadcrumb['text']; ?></span>
    </a>
    <meta itemprop="position" content="<?php echo $key; ?>" />
  </li>
  <?php } else {?>
  <li class="active"><?php echo $breadcrumb['text']; ?></li>
  <?php } ?>
  <?php } ?>
</ul>

Обновите кэш шаблонов и модификаторов если это требуется


×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.