These snippets allow you to show nodes in two columns on any teaser listing page. It works for PHPtemplate

in template.php add:

function _exampletheme_nodebreak($node) {
  static $count;
  if ($node->sticky) {
   return TRUE;
  }
  else {
    $count = is_int($count) ? $count : 1;
    $return = ($count % 2) ? FALSE : TRUE;
    $count++;
    //dprint_r('WOOT');
    return $return;
  }
}

in node.tpl.php add to the end (after all the node content)

<?php if (($page == 0) && _exampletheme_nodebreak($node)): ?>
<br class="clear" />
<?php endif; ?>

And add to your style.css, a something like:

#contentcenter .node.teaser {
  float: left;
  width: 223px; //for fluid layout use 50%
  margin-left: 20px; //for fluid layout set to 0;
  padding: 0;
}

Note that you can play aroun with the values and make it a three column mayout without much hassle too.

Comments

buzink’s picture

It works, but you'll have to adjust the css, in order to make it work with your theme. For Garland (the default theme in 5) it is something like:

.node {
  float: left;
  width: 223px; //for fluid layout use 50%
  margin-left: 20px; //for fluid layout set to 0;
  padding: 0;
}
buzink’s picture

The disadvantage of this method is the gaps that it produces. (When, on the same row, a short teaser on the left side is paired with a long teaser on the right side, there will be a gap under the text on the left side, because the next row will start under the longest article).

It's probably better and easier to use the views module with the views bonus pack (http://drupal.org/project/views_bonus) and the frontpage module. It allows you to create a node with a view (views module) that can be divided into columns with the help of so called panels (views bonus pack). This page can be turned into the frontpage (frontpage module).