schema.org:具有多个元素的SiteNavigationElement [英] schema.org: SiteNavigationElement with multiple elements
问题描述
我正在尝试为菜单导航实现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完全索引,我可以在 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.
因此显然必须有一个错误.
So there must be an error obviously.
- 为什么Google只看到一个链接?
- 为什么总是最后一个链接?
- Why is google only seeing one link?
- And why is it always the last 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 版本2.2 ),例如您的示例中的name
:它是用于导航的名称(例如,"Navigation"),而不是用于导航条目的名称.
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屋!