2013-07-11 17 views
7

一則新聞後會像如何使用微數據標記「相關新聞」?

<article itemscope itemtype="http://schema.org/NewsArticle">  

    <h1 itemprop="headline">Awesome News</h1>  

    <div itemprop="articleBody"> 
    bla bla bla... 
    </div> 

</article> 

我想如果包括相關的新聞和標記呢?

<ul> 
    <li><a href="related_news_1.html">Related News 1</a></li> 
    <li><a href="related_news_2.html">Related News 2</a></li> 
    <li><a href="related_news_3.html">Related News 3</a></li> 
</ul> 

回答

5

嘗試使用元素從網頁項目類型(來源:http://schema.org/WebPage,我知道你是在這種情況下使用NewsArticle,但我用文章在這個例子中):

<div itemscope itemtype="http://schema.org/Article"> 
    <span itemprop="name">How to Tie a Reef Knot</span> 
    by <span itemprop="author">John Doe</span> 
    This article has been tweeted 1203 times and contains 78 user comments. 
    <meta itemprop="interactionCount" content="UserTweets:1203" /> 
    <meta itemprop="interactionCount" content="UserComments:78" /> 
</div> 


<ul itemscope itemtype="http://schema.org/WebPage"> 
    <li itemprop="relatedLink"><a href="related_news_1.html">Related News 1</a></li> 
    <li itemprop="relatedLink"><a href="related_news_2.html">Related News 2</a></li> 
    <li itemprop="relatedLink"><a href="related_news_3.html">Related News 3</a></li> 
</ul> 

谷歌網站管理員工具看到它像這樣:

enter image description here

或者你可以這樣說:

<ul itemscope itemtype="http://schema.org/WebPage"> 
    <li><a href="related_news_1.html" itemprop="relatedLink">Related News 1</a></li> 
    <li><a href="related_news_2.html" itemprop="relatedLink">Related News 2</a></li> 
    <li><a href="related_news_3.html" itemprop="relatedLink">Related News 3</a></li> 
</ul> 

而谷歌認爲它是這樣,那麼:

enter image description here

+2

不會將您的第一個例子('itemprop = 「relatedLink」''上的li'代替'了')被錯當成[ 'relatedLink'具有期望的類型'URL'](http://schema.org/WebPage)? – unor

+1

這就是爲什麼我附上了兩個例子。谷歌在兩種情況下都對待它,所以我認爲它是正確的(同時我也使用上述兩種方法,並且從未遇到索引問題,但也許你是對的:)) – Archios

相關問題