Which Schema.org property should I use for popular posts item list?

孤街浪徒 提交于 2019-12-11 11:43:45

问题


Example markup of what I have:

<body  itemscope='itemscope' itemtype='http://schema.org/WebPage'>
    <div id="main" itemprop='mainContentOfPage' itemscope='itemscope' itemtype="http://schema.org/Blog">
        <article itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'>
            blah blah blah
        </article>
    <div>
    <aside>
        <ul>
            <li><article><img/>popular post article</article></li>
            <li><article><img/>popular post article</article></li>
        </ul>
    </aside>
</body>

What should I use for the articles within each list item? I thought of articleSection, but that doesn't make sense because it's not within an article schema. So I'm trying to wrap my around the best way to add Microdata here.

Moving the aside within the article isn't really a viable option either. This is Blogger, so doing that would be tricky, especially on the admin widget-management side of things.


回答1:


Update (2016): In the meantime Schema.org introduced a property to denote that an item is the main/primary one for a page: mainEntity (see details). So the below answer is somewhat out of date.


If they are also blog posts, you would use BlogPosting, too.

Microdata is not only for the main content of a page. However, the Schema.org vocabulary currently lacks a property to mark an item as the main content item of a page (the property mainContentOfPage is only allowed for WebPage).

By using articleBody for the main BlogPosting, capable consumers should be able to deduce that the other BlogPosting items on the page (which naturally don’t have the articleBody property) are only linked/related posts.


So it could look like:

<div itemscope itemtype="http://schema.org/Blog">

  <article itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting">
    <div itemprop="articleBody">…</div>
  </article>

  <aside>
    <ul>
      <li>
        <article itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting">
          <a href="/post-4" itemprop="url"><span itemprop="name">Post 4</span></a>
        </article>
      </li>
      <li>
        <article itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting">
          <a href="/post-5" itemprop="url"><span itemprop="name">Post 5</span></a>
        </article>
      </li>
    </ul>
  </aside>

</div>


来源:https://stackoverflow.com/questions/27216042/which-schema-org-property-should-i-use-for-popular-posts-item-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!