Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By gmak on
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
adding a div..
try this:
Change the output line from this:
to this:
I think that will wrap each result in it's own DIV with a class called "special".
Phil
I've already tried that...
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?