schema.org SiteNavigationElement的正确用法是什么? [英] What is the correct use of schema.org SiteNavigationElement?
问题描述
是否最好将该计划放在包含所有链接的父级?
< nav itemscope =itemscopeitemtype =http://www.schema.org/SiteNavigationElement>
< a href =#>连结1< / a>
< a href =#>连结2< / a>
< a href =#>连结3< / a>
< / nav>
...或者应该将每个链接视为自己的元素?
< nav>
< span itemscope =itemscopeitemtype =http://www.schema.org/SiteNavigationElement>
< a itemprop =urlhref =#>
< span itemprop =name>连结1< / span>
< / a>
< / span>
< span itemscope =itemscopeitemtype =http://www.schema.org/SiteNavigationElement>
< a itemprop =urlhref =#>
< span itemprop =name>连结2< / span>
< / a>
< / span>
< span itemscope =itemscopeitemtype =http://www.schema.org/SiteNavigationElement>
< a itemprop =urlhref =#>
< span itemprop =name>连结3< / span>
< / a>
< / span>
< / nav>
如果 如果 我认为Schema.org没有明确定义哪个变体的意思,因为他们只说: 页面的导航元素。 但是,父类型 网页元素,如表格或图片 此外,所有其他子类型(如 所以这似乎表明整个导航应该被标记,而不是每个单链接: 在这种情况下,所有属性都属于整个导航,所以这意味着 In SEO terms... Is it best to put the scheme on the parent containing all the links? ...or should each link be considered as it's own element?
If If I think Schema.org doesn’t unambiguously define which variant is meant, as they only say: A navigation element of the page. However, the parent type A web page element, like a table or an image Also, all the other child types (like So this seems to suggest that the whole navigation should be marked up, and not each single link: In this case, all the properties belong to the whole navigation, so that means the 这篇关于schema.org SiteNavigationElement的正确用法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! SiteNavigationElement $
SiteNavigationElement 是整个导航(即导航链接列表)的意思, code>用于单个导航条目(即导航链接列表中的链接),您的第二个示例是正确的。
WebPageElement
定义为:
表
或 WPFooter
)似乎用于整个事情,而不是事物的特定部分。
< nav itemscope itemtype =http://schema.org/SiteNavigationElement >
< ul>
< li>< a href =/ link-1>链接1< / a>< / li> <! - 不要在这里使用'url'或'name'属性! - >
< li>< a href =/ link-2>链接2< / a>< / li>
< / ul>
< / nav>
url
属性将为此导航指定一个URL(而 not 此导航中链接的URL!)。<nav itemscope="itemscope" itemtype="http://www.schema.org/SiteNavigationElement">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</nav>
<nav>
<span itemscope="itemscope" itemtype="http://www.schema.org/SiteNavigationElement">
<a itemprop="url" href="#">
<span itemprop="name">Link 1</span>
</a>
</span>
<span itemscope="itemscope" itemtype="http://www.schema.org/SiteNavigationElement">
<a itemprop="url" href="#">
<span itemprop="name">Link 2</span>
</a>
</span>
<span itemscope="itemscope" itemtype="http://www.schema.org/SiteNavigationElement">
<a itemprop="url" href="#">
<span itemprop="name">Link 3</span>
</a>
</span>
</nav>
SiteNavigationElement
is meant for the whole navigation (i.e., a navigation link list), your first example is correct.SiteNavigationElement
is meant for a single navigation entry (i.e., a link in the navigation link list), your second example is correct.
WebPageElement
is defined as:
Table
or WPFooter
) seem to be used for the whole thing, and not specific parts of the thing.<nav itemscope itemtype="http://schema.org/SiteNavigationElement">
<ul>
<li><a href="/link-1">Link 1</a></li> <!-- don’t use the 'url' or 'name' property here! -->
<li><a href="/link-2">Link 2</a></li>
</ul>
</nav>
url
property would specify a URL for this navigation (and not the URLs of the links in this navigation!).