schema.org:具有多个元素的 SiteNavigationElement [英] schema.org: SiteNavigationElement with multiple elements

查看:22
本文介绍了schema.org:具有多个元素的 SiteNavigationElement的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的菜单导航实现 schema.org 微数据.此导航将类似于以下内容:

I am trying to implement schema.org microdata for my menu navigation. This navigation will look similar to this:

<ul>
    <li><a href="#"><span>Name1</span></a></li>
    <li><a href="#"><span>Name2</span></a></li>
    <li><a href="#"><span>Name3</span></a></li>
</ul>

我想使用 SiteNavigationElement,不幸的是,我只能找到没有明确回答如何使用多个元素的示例.

I want to make use of SiteNavigationElement, unfortunately all I could find where examples with no clear answer of how to make use of multiple elements.

有人确切知道如何在多个元素上使用 SiteNavigationElement 吗?

Does anybody know for sure, how to use SiteNavigationElement on multiple elements?

更新:

这是我在阅读重复链接中的所有答案后想出的原始菜单结构:

This is my original menu structure I came up with after reading all answers in the duplicate link:

<nav class="menu" itemscope itemtype="http://schema.org/SiteNavigationElement">
    <ul class="main-menu" role="menubar">
        <li class="main-menu">Home</li>
        <li class="parent">
            <ul class="sub-menu">
                <li><a itemprop="url" role="menuitem" href="index.php"><span itemprop="name">Home</span></a></li>
                <li><a itemprop="url" role="menuitem" href="tricks.php"><span itemprop="name">Tricks</span></a></li>
                <li><a itemprop="url" role="menuitem" href="features.php"><span itemprop="name">Features</span></a></li>
            </ul>
        </li>
    </ul>
 </nav>

现在,所有内容都已被谷歌完全索引,我可以在 Google 网站管理员工具中看到它.

Now, everything has been fully indexed by google and I am able to see it in Google Webmaster Tools.

那么 Google 站长工具是如何看待它的呢?

Page URL   | Items | Items with errors | Last detected |    Name    | Errors
----------------------------------------------------------------------------
Page1.php  |   1   |          -        |     2/11/16   |  Features  |    -
Page2.php  |   1   |          -        |     2/11/16   |  Features  |    -
Page3.php  |   1   |          -        |     2/11/16   |  Features  |    -
Page4.php  |   1   |          -        |     2/11/16   |  Features  |    -
...

我所有被索引并有菜单的页面(Page1.php - Page4.php),每个只有1项.并且检测到的项目始终只是 SiteNavigationElement 中指定的最后一个链接.

All my pages which have been indexed and have the menu (Page1.php - Page4.php), each only have 1 item. And the detected item is always only the last link specified in SiteNavigationElement.

那么显然肯定有错误.

  • 为什么 google 只看到 一个 链接?
  • 为什么它总是最后一个链接?

推荐答案

这是我在阅读了重复链接中的所有答案后想出的原始菜单结构

This is my original menu structure I came up with after reading all answers in the duplicate link

除了我的回答,似乎 ;-) 正如我在我对可能重复的问题的回答中所解释的,url 属性应该用于每个导航链接.相反,url 属性应该为整个导航提供一个 URL(通常不存在).

Except my answer, it seems ;-) As I explained in my answer to the possibly duplicate question, the url property should not be used for each navigation link. Instead, the url property should provide a URL for the whole navigation (which, typically, doesn’t exist).

其他所有 SiteNavigationElement 属性也是如此(从 Schema.org version 2.2),就像你的例子中的 name :它是导航的名称(例如,导航"),而不是导航条目的名称.

The same goes for every other SiteNavigationElement property (as of Schema.org version 2.2), like name in your example: it’s for the name of the navigation (e.g., "Navigation"), not for the names of the navigation entries.

所以使用 SiteNavigationElement 似乎不是很有用.WebPageElement 及其其他子类型也是如此.它们在特殊情况和非 HTML 上下文中可能有用,但通常我不会将它们用于典型网页.

So using the SiteNavigationElement does not seem to be very useful. The same is the case with WebPageElement and its other sub-types. They may be useful in special cases and in non-HTML contexts, but generally I wouldn’t use them for typical Web pages.

这篇关于schema.org:具有多个元素的 SiteNavigationElement的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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