I'm working on the new MM Real Estate site which is being built around a full-fledged Code Igniter powered custom content management system. It's the best one I've designed yet and its quite powerful. As I build out the display templates I come to the displays for the blog/articles portion I have to show the main list of articles in typical blog fashion: headline, date, and snippet from the article as a teaser along with the link. I've coded this particular setup in a variety of ways over the years, from using a combination of <hx> and <p>, to using <dl>,<dt> and <dd> in an attempt to find the ideal way to code this up. Here's the page I'm working on (this link may disappear once the site launches): http://mm.sitesbyjoe.com/articles As of this moment I've opted for the definition list approach, like this:
<dl>
  <dt><a href="#">My Headline</a></dt>
  <dd>Published on My Date</dd>
  <dd>The Snippet of my article</dd>
  <dd><a href="#">Link</a></dd>
</dl>
That seems to work fine. Then I think about using microformats. I look up the microformat used for news articles and I find:
hAtom is a microformat for identifying semantic information in weblog posts and practically any other place Atom (http://www.atomenabled.org/) may be used, such as news articles. hAtom content is easily added to most blogs by simple modifications to the blog's template definitions.
hAtom? Sounds good so far. Looking deeper I find:
The hAtom schema consists of the following:
    • hfeed (hfeed). optional.
    • feed category. optional. keywords or phrases, using rel-tag.
    • hentry (hentry).
      • entry-title. required. text.
      • entry-content. optional (see field description). text. [*]
      • entry-summary. optional. text.
      • updated. required using datetime-design-pattern. [*]
      • published. optional using datetime-design-pattern.
      • author. required using hCard. [*]
      • bookmark (permalink). optional, using rel-bookmark.
      • tags. optional. keywords or phrases, using rel-tag.
So basically I'd need to modify my markup to be:
<dl class="hentry">
  <dt class="entry-title"><a href="#" rel="bookmark">My Headline</a></dt>
  <dd class="published">Published on My Date</dd>
  <dd class="entry-summary">The Snippet of my article</dd>
  <dd><a href="#" rel="bookmark">Link</a></dd>
</dl>
Pretty easy to be hAtom compliant and that should allow the article information to be easily absorbed by any internet device and easily read by internet spidering programs. Here's the day's final code - this examples uses some syntax for Code Igniter functions:
<div id="articles_list">
  <?php
  if ($articles->num_rows() > 0)
  {
    foreach ($articles->result() as $article)
    {
    ?>
      <dl class="hentry">
        <dt class="entry-title"><a href="" rel="bookmark"><?=$article->headline?></a></dt>
        <dd class="published">Published on <?=date('M d', strtotime($article->datestamp))?></dd>
        <dd class="entry-summary"><?=substr(strip_tags($article->story), 0, 125)?>...
        <a href="" title="<?=$article->headline?>" rel="bookmark">Read this Article</a></dd>
      </dl>
     <?php
    }
  }
  ?>
</div>
Here it is after performing some cleanup on my code:
<?php
function create_summary($str, $num_words)
{
	$summary = '';
	// remove any html elements
	$str = strip_tags($str);
	// make an array of the words
	$words = explode(' ', $str);
	// rebuild from the array using our limit						
	for ($i = 0; $i < $num_words; $i++)
	{
		$summary .= $words[$i] . ' ';
	}
	// spit the string back
	echo trim($summary);
}
?>

<div id="articles_list">
<?php 
if ($articles->num_rows() > 0) 
{
	foreach ($articles->result() as $article)
	{
	        ?>
		<dl class="hentry">
		<dt class="entry-title"><a href="/articles/index/<?=$article->slug?>" rel="bookmark"><?=$article->headline?></a></dt>
		<dd class="published">Published on <?=date('l, F d, Y', strtotime($article->datestamp))?></dd>
		<dd class="entry-summary"><?=create_summary($article->story, 50)?>...</dd>
		<dd><a href="/articles/index/<?=$article->slug?>" title="<?=$article->headline?>" rel="bookmark">Read this Article</a></dd>
		</dl>
		<?php 
	}
}
?>
</div>
Not too shabby.