Is it good to put HTML5 Microdata on preview blocks?

元气小坏坏 提交于 2019-12-24 03:58:06

问题


Consider this example:

<section id="news_block_left" class="block" itemscope="" itemtype="http://schema.org/ItemList">
    <a href="http://dev.com/index.php?controller=NewsList" title="News" itemprop="url">
        <h2 class="title_block" itemprop="name">News</h2>
    </a>
    <div class="block_content">
        <ul class="news-list">
            <li itemprop="itemListElement" itemscope="" itemtype="http://schema.org/NewsArticle">
                <a href="http://dev.com/index.php?id_news=7&controller=News" title="News Title1" itemprop="url">
                    <span><span itemprop="datePublished">2015-03-30</span> <em itemprop="headline">News Title1</em></span>
                </a>
            </li>
            <li itemprop="itemListElement" itemscope="" itemtype="http://schema.org/NewsArticle">
                <a href="http://dev.com/index.php?id_news=8&controller=News" title="T230 series (1999–2006)" itemprop="url">
                    <span><span itemprop="datePublished">2015-03-08</span> <em itemprop="headline">T230 series (1999–2006)</em></span>
                </a>
            </li>
        </ul>
        <meta itemprop="numberOfItems" content="2">
        <a class="more_news" href="http://dev.com/index.php?controller=NewsList" title="More news">
            <span>More news</span>
        </a>
    </div>
</section>

This block exists in the sidebar, it doesn't contain full news element data, only a couple of link this them.

The link "More news" leads to a more complete list with more markup (but still only a list with links to the actual articles).

Is there a benefit in putting Microdata on such preview lists? Or is Microdata intended for complete pages (complete news page with body, product page, etc.)?

P.S. Don't mind the unfriendly URLs, it's only dev version.


回答1:


That’s fine. It’s in no way required to use Microdata only for certain content. The same goes for the vocabulary Schema.org. The more the merrier.

Thanks to using Schema.org’s url property for each NewsArticle item, consumers have the chance to learn that these items have separate URLs with probably (but not necessarily) more relevant content.

On a side note: You might want to use name instead of headline (or name in addition). The name property, as it can be used on all Schema.org types, has probably more support than the headline property, which can only be used on CreativeWork types. (Currently it gets discussed if headline should be marked superseded by name.)



来源:https://stackoverflow.com/questions/29764039/is-it-good-to-put-html5-microdata-on-preview-blocks

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