繁体   English   中英

我已将微数据添加到网页HTML中,但是在从CMS发布时会显示

[英]I've added Microdata to web page HTML, but it shows up on publishing from CMS

如searchengineland.com中所述,我添加了以下导航标记,但它在发布网站时显示在标题上方。 我希望它能像附件中的图像一样显示在Google搜索结果中:

搜索结果的站点导航菜单示例

我正在使用Mac的Sandvox来发布站点。 我应该在哪里添加Microdata HTML?

我试图将其放在此代码内,并且仅打印在已发布的页面上:

<div  itemscope itemtype="http://schema.org/LocalBusiness" id="sitemenu">
.....
<div itemscope itemtype="http://schema.org/SiteNavigationElement">
<ul itemscope itemtype="http://www.schema.org/SiteNavigationElement">
<li itemprop="name"><a itemprop="url" href="http://www.travelstore.com/our-   advantage">Our Advantage</a></li>
<li itemprop="name"><a itemprop="url" href="http://www.travelstore.com/our- travel-experts">Travel Experts</a></li>
<li itemprop="name"><a itemprop="url" href="http://www.travelstore.com/destinations">Destinations</a></li>
<li itemprop="name"><a itemprop="url" href="http://www.travelstore.com/cruises">Cruises</a></li>
<li itemprop="name"><a itemprop="url" href="http://www.travelstore.com/interests">Interests</a></li>
<li itemprop="name"><a itemprop="url" href="http://www.travelstore.com/explore-your-world/interests/hotels-and-resorts">Hotels</a></li>
<li itemprop="name"><a itemprop="url" href="http://www.travelstore.com/travel-guides">Travel Resources</a></li>
</ul>
</div>

您的Google搜索结果屏幕截图显示了两个功能:

  • 搜索结果站点的搜索字段
  • 链接到网站其他页面

可以提供结构化数据标记来获取第一个功能( 站点 链接搜索框 ), 而不能提供结构化数据标记来获取第二个功能( 站点链接 )。

Google Search似乎没有使用Schema.org的SiteNavigationElement类型的任何结果功能。 建议完全不要使用SiteNavigationElement

如果仍然要使用SiteNavigationElement ,请注意您使用的方式不正确: 您只能标记整个导航 ,而不能标记单个导航链接。 因此, SiteNavigationElementurlname属性用于URL和导航本身的名称(并且导航通常不包含这些属性)。 因此它将是:

<ul itemscope itemtype="http://schema.org/SiteNavigationElement">
  <li><a href="http://www.travelstore.com/our-advantage">Our Advantage</a></li>
  <li><a href="http://www.travelstore.com/our-travel-experts">Travel Experts</a></li>
  <li><a href="http://www.travelstore.com/destinations">Destinations</a></li>
</ul>

(请注意,Schema.org URI应该在没有www子域的情况下指定。)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM