Jump to content

Recommended Posts

Здравствуйте! Столкнулся с такой интересной темой.

 

Валидатор структурированных данных стал ругаться вот так

Спойлер
Цитата
@type
BreadcrumbList
itemListElement
 
@type
ListItem
position
1
item
 
@type
Thing
name
Главная
cancel
 
Для item.id указан недопустимый URL.

 

 

Вот таким образом формируются хлебные крошки:

Спойлер

 <ul class="breadcrumb" itemscope itemtype="https://schema.org/BreadcrumbList">
    {% for key, breadcrumb in breadcrumbs %}
      <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
      <a itemscope itemtype="https://schema.org/Thing" itemprop="item" href="{{ breadcrumb.href }}"><span itemprop="name">{{ breadcrumb.text }}</span></a>
      <meta itemprop="position" content="{{key+1}}" />
      </li>
    {% endfor %}
  </ul>

 

 

p.s. Я понимаю что это близко к бреду :)  живое любопытство.

Share this post


Link to post
Share on other sites

Методом добавления Item.id  - Ошибка пропала, но

Спойлер

ul class="breadcrumb" itemscope itemtype="https://schema.org/BreadcrumbList">
    {% for key, breadcrumb in breadcrumbs %}
      <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
	  <a itemscope itemtype="https://schema.org/Thing" itemprop="item" href="{{ breadcrumb.href }}" itemid="{{ breadcrumb.href }}"><span itemprop="name">{{ breadcrumb.text }}</span></a>
	  <meta itemprop="position" content="{{key+1}}" />
	  </li>
    {% endfor %}
  </ul>

 

 

Но Получается по 2 ссылки в коде 

Спойлер

  <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
	  <a itemscope itemtype="https://schema.org/Thing" itemprop="item" href="ссылка" itemid="ссылка"><span itemprop="name">Имя страницы</span></a>
	  <meta itemprop="position" content="2" />
	  </li>

 

 

Просто href незаменить на item.id - тогда хлебные крошки становятся не активными.

 

У кого какие мнения?

 

Edited by Malik
Добавление

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×

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.