为什么我的http://schema.org/BreadcrumbList无法验证? [英] Why is my http://schema.org/BreadcrumbList not validating?

查看:101
本文介绍了为什么我的http://schema.org/BreadcrumbList无法验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站上使用schema.org微数据,但是我在与 BreadcrumbList 像Google一样在挣扎结构化数据测试工具不会对其进行验证。

I'm using schema.org microdata on my web site but I'm struggling with the BreadcrumbList as Google's structured data testing tool will not validate it. It looks correct and I can't see what's wrong.

您可以单击上面的链接查看错误,但总而言之,Google表示itemtype属性有一个每个项目的值都无效,并且还抱怨列表中缺少mainEntityOfPage属性。我确实尝试在meta标记中添加mainEntityOfPage,但是它仍然对此抱怨。

You can click the above link to see the errors, but to summarise, Google says that the itemtype attribute has an invalid value for each of the items and also complains that the mainEntityOfPage attribute is missing from the list. I did try adding mainEntityOfPage in a meta tag but it still complained about it.

我在做什么错了?

<ul itemscope="" itemtype="http://schema.org/BreadcrumbList">
    <li class="home" itemscope="" itemprop="itemListElement" itemtype="http://schema.org/ListItem">
        <a href="http://www.rossmod.co.uk/" title="Go to Home Page" itemprop="item"><span itemprop="name">Home</span></a>
        <span>/ </span>
        <meta itemprop="position" content="1">
    </li>
    <li class="category3" itemscope="" itemprop="itemListElement" itemtype="http://schema.org/ListItem">
        <a href="http://www.rossmod.co.uk/rc-cars.html" title="" itemprop="item"><span itemprop="name">RC Cars</span></a>
        <span>/ </span>
        <meta itemprop="position" content="2">
    </li>
    <li class="category10" itemscope="" itemprop="itemListElement" itemtype="http://schema.org/ListItem">
        <a href="http://www.rossmod.co.uk/rc-cars/car-kits.html" title="" itemprop="item"><span itemprop="name">Car Kits</span></a>
        <span>/ </span>
        <meta itemprop="position" content="3">
    </li>
    <li class="product">
        <strong>Tamiya Lunch Box. No ESC [58347]</strong>
    </li>
</ul>


推荐答案

面包屑必须使用面包屑属性,并将其放在另一个itemscope中(最好是 http://schema.org/WebPage )。您还缺少的是 itemprop = breadcrumb ,它必须在 itemscope 之前。

The breadcrumbs must use the breadcrumb property, and put this inside another itemscope (ideally http://schema.org/WebPage). You are also missing is itemprop="breadcrumb which must be right before your itemscope.

<div class="breadcrumbs" itemscope itemtype="http://schema.org/WebPage"> 
<ul itemprop="breadcrumb" itemscope="" itemtype="http://schema.org/BreadcrumbList">
<li class="home" itemscope="" itemprop="itemListElement" itemtype="http://schema.org/ListItem">
    <a href="http://www.rossmod.co.uk/" title="Go to Home Page" itemprop="item"><span itemprop="name">Home</span></a>
    <span>/ </span>
    <meta itemprop="position" content="1">
</li>
<li class="category3" itemscope="" itemprop="itemListElement" itemtype="http://schema.org/ListItem">
    <a href="http://www.rossmod.co.uk/rc-cars.html" title="" itemprop="item"><span itemprop="name">RC Cars</span></a>
    <span>/ </span>
    <meta itemprop="position" content="2">
</li>
<li class="category10" itemscope="" itemprop="itemListElement" itemtype="http://schema.org/ListItem">
    <a href="http://www.rossmod.co.uk/rc-cars/car-kits.html" title="" itemprop="item"><span itemprop="name">Car Kits</span></a>
    <span>/ </span>
    <meta itemprop="position" content="3">
</li>
<li class="product">
    <strong>Tamiya Lunch Box. No ESC [58347]</strong>
</li>
</ul>

这篇关于为什么我的http://schema.org/BreadcrumbList无法验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆