I'm using this php page snippet

<?php
/**
* This php snippet displays content of a specified type, with teasers,
* from certain taxonomy term.
* Sorted by date of creation, most recent first.
* Works with nodes of the flexinode type too.
* To change the length of the list, change $listlength.
* To change the taxomony term, change $taxo_id.
* To change the type of content listed, change the $content_type.
* Tested with Drupal 4.6.3
*/
  $listlength="5";
  $taxo_id = 1;
  $content_type = 'story';
  $result1 = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n INNER JOIN term_node ON n.nid = term_node.nid WHERE n.type = '$content_type' AND term_node.tid = $taxo_id AND n.status = 1 ORDER BY n.created DESC"), $listlength);
  while ($node = db_fetch_object($result1)) {
    $output .= node_view(node_load(array('nid' => $node->nid)), 1);
  }
print $output;
?>

I'd like to be able to put each result into it's own

so that they can each have borders, etc. But, I can't see how this would be possible.

Is there a way to do this?

Comments

Phillip Mc’s picture

try this:

Change the output line from this:

$output .= node_view(node_load(array('nid' => $node->nid)), 1);

to this:

$output .= '<div class="special">';
$output .= node_view(node_load(array('nid' => $node->nid)), 
1);
$output .= '</div>';

I think that will wrap each result in it's own DIV with a class called "special".

Phil

gmak’s picture

Thanks for the try, but I've already attempted that solution. That approach puts a DIV around the whole array of what is returned, not around each individual item from th array.

Next attempt?