Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to markup "Related News" using microdata?

A news post would be like

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

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

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

</article>

What if I would like to include related news and markup them?

<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>
like image 426
amachino Avatar asked Jul 11 '13 08:07

amachino


People also ask

What is microdata used for?

Microdata is part of the WHATWG HTML Standard and is used to nest metadata within existing content on web pages. Search engines and web crawlers can extract and process microdata from a web page and use it to provide a richer browsing experience for users.

What is Schema Microdata?

Microdata is a form of structured data which is used to insert metadata within existing webpage content. In a nutshell, microdata allows you to provide labels for individual content elements using 'name:value' pairs.


1 Answers

Try using element from WebPage itemtype (from: http://schema.org/WebPage, I know that You are using NewsArticle in this case, but I used Article for this example):

<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>

Google Webmaster Tools sees it like this:

enter image description here

Alternatively You can do it like this:

<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>

And Google sees it like this then:

enter image description here

like image 175
Archios Avatar answered Oct 02 '22 11:10

Archios