Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Хлебные крошки: Отсутствует поле "itemListElement"


Recommended Posts

Здравствуйте,

Периодически приходит от Гугла такой мэил:

 

Отсутствует поле  "ItemListElemnt"

 

image.png.9e3281cb694c9cc767b6cffce1257199.png

 

image.png.a6e64808c8729270bdc93a3373c66efe.png

 

Пример страницы с проблемой:
https://shukrehut.co.il/naushniki-igrovye-as03-v-izraile

 

Собственно, отмечены все страницы сайта.

Выделен красным этот кусок:

image.png.fc583d382eca6227f5690d08af633571.png

 

<ul class="breadcrumb tab_mob_child" itemscope itemtype="http://schema.org/BreadcrumbList">
<li class="tab_mob_grandchild"><a href="https://shukrehut.co.il/" class="current-link"><i class="fa fa-home"></i></a></li>
</ul>

 

Я думаю, что проблема в файле product.twig

 

Вот в этом кусочке:

<ul class="breadcrumb tab_mob_child" itemscope itemtype="http://schema.org/BreadcrumbList">
{% for i,breadcrumb in breadcrumbs %}
    {% if (i == 0) %}
        <li class="tab_mob_grandchild"><a href="{{ breadcrumb['href'] }}" class="current-link">{{ breadcrumb['text'] }}</a></li>
    {% elseif (breadcrumbs|length > i+1 ) %}
        <li class="tab_mob_grandchild" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
            <a href="{{ breadcrumb['href'] }}" itemprop="item" itemscope itemtype="https://schema.org/Thing" itemid="{{ breadcrumb['href'] }}" title="{{ breadcrumb['text'] }}">
                <span itemprop="name">{{ breadcrumb['text'] }}</span>
            </a>
            <meta itemprop="position" content="{{ i }}">
        </li>
    {% endif %}
{% endfor %}
</ul>

 

Скорее всего в строчку 
<li class="tab_mob_grandchild"><a href="{{ breadcrumb['href'] }}" class="current-link">{{ breadcrumb['text'] }}</a></li>
нужно добавить itemprop="itemListElement".


Я пытался, но получал другие ошибки: отсутствует "name" или "item.name".

Что исправить, чтобы Гугл не ругался?
 

Кстати, может быть кто-то уже решал эту проблему. Вот этот шаблон:

Спасибо.

product.twig

Link to comment
Share on other sites


  • 1 year later...
12.09.2021 в 17:52, Mishanya1 сказал:

Здравствуйте,

Периодически приходит от Гугла такой мэил:

 

Отсутствует поле  "ItemListElemnt"

 

image.png.9e3281cb694c9cc767b6cffce1257199.png

 

image.png.a6e64808c8729270bdc93a3373c66efe.png

 

Пример страницы с проблемой:
https://shukrehut.co.il/naushniki-igrovye-as03-v-izraile

 

Собственно, отмечены все страницы сайта.

Выделен красным этот кусок:

image.png.fc583d382eca6227f5690d08af633571.png

 

<ul class="breadcrumb tab_mob_child" itemscope itemtype="http://schema.org/BreadcrumbList">
<li class="tab_mob_grandchild"><a href="https://shukrehut.co.il/" class="current-link"><i class="fa fa-home"></i></a></li>
</ul>

 

Я думаю, что проблема в файле product.twig

 

Вот в этом кусочке:

<ul class="breadcrumb tab_mob_child" itemscope itemtype="http://schema.org/BreadcrumbList">
{% for i,breadcrumb in breadcrumbs %}
    {% if (i == 0) %}
        <li class="tab_mob_grandchild"><a href="{{ breadcrumb['href'] }}" class="current-link">{{ breadcrumb['text'] }}</a></li>
    {% elseif (breadcrumbs|length > i+1 ) %}
        <li class="tab_mob_grandchild" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
            <a href="{{ breadcrumb['href'] }}" itemprop="item" itemscope itemscope="https://schema.org/Thing" itemid="{{ breadcrumb['href'] }}" title="{{ breadcrumb['text'] }}">
                <span itemprop="name">{{ breadcrumb['text'] }}</span>
            </a>
            <meta itemprop="position" content="{{ i }}">
        </li>
    {% endif %}
{% endfor %}
</ul>

 

Скорее всего в строчку 
<li class="tab_mob_grandchild"><a href="{{ breadcrumb['href'] }}" class="current-link">{{ breadcrumb['text'] }}</a></li>
нужно добавить itemprop="itemListElement".


Я пытался, но получал другие ошибки: отсутствует "name" или "item.name".

Что исправить, чтобы Гугл не ругался?
 

Кстати, может быть кто-то уже решал эту проблему. Вот этот шаблон:

Спасибо.

product.twig 66 \u041a\u0431 · 5 скачиваний

 у вас, чтобы сделать первую ссылку - подсветка или зачем я не знаю, сделан ифачок. И она (дом или главная страница) никогда не является хлебной крошкой

Я не могу ваш сайт открыть и глянуть, что там не так. Можете просто удалить из этого куса кода все упоминания itemprop itemscope и itemtype и тег <meta itemprop="position" content="{{ i }}">

И сразу после этого ul добавить вот этот код

<script type="application/ld+json">
          {
            "@context": "http://schema.org",
            "@type": "BreadcrumbList",
            "itemListElement": [
			{% for i,breadcrumb in breadcrumbs %}
			{
              "@type": "ListItem",
              "position": {{ i + 1 }},
              "item": {
                "@id": "{{ breadcrumb['href'] }}",
                "name": "{{ breadcrumb['text'] }}"
              }
            }{% if (i + 1 < breadcrumbs|length) %},{% endif %}
			{% endfor %}
			]
          }
        </script>

 

Вроде так. Почистить кеш шаблона и модификаций и должно стать ок. 

 

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

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.