Hi
I have been browsing the Drupal PHP snippets but can't seem to find the right PHP code to do this task.

I'd like to display a list of Nodes in a certain taxonomy category, with brief teasers, linking to the full articles. This list needs to be paginaed so that after every 100 nodes, it has a link to a page with the next 100. The list should be ordered by date created. It should contain no links to the taxonomy terms for each of the nodes.

I have tried some of the codes but the teaser have also displayed links to the various taxonomy categories, which I don't want

Just
Link:Title of the Node
teaser.....................
teaser.....................
break......................
(Repeat for each node in order of date created)

The reason I want to do this is to create different sitemaps for each major section of the site where someone could browse all of the recent nodes but see a small excerpt, perhaps limited to a line or two for each of the pages. Not a huge amount of text but just a small little excerpt for each. This would also help in Google since it wouldn't be just a page of links for the bots to follow.

thanks!
decon

Comments

coreyp_1’s picture

What snippets have gotten close to what you want?

Something tells me that it would be easier to modify them than to start from scratch.

decon’s picture

http://drupal.org/node/30967

I tried this snippet here. It is close -- but the problem is that when it displays the teaser, it is displaying way too much. I only want a few lines, maybe the first few lines, and I don't want the taxonomy/category links to be displaying for each, which in this snippet it is.

Basically something like this, but paginated, so that I could create a sitemap limited to lets say 100 a page.

I've seen some other code snippets for pagination but maybe I missed one that does all this together.

thanks!

coreyp_1’s picture

the taxonomy can be hidden using CSS

span.taxonomy {
  display:none;
}

The teaser length is determined by the value set at admin/node/configure. This sets a default break point at X characters. To set a different break point, try using the <!--break--> delimiter to determine where you want the break instead.

Are we going in the right direction?

decon’s picture

I tried the code mentioned by the guy running hogmaney which limits the text returned. I plugged in some breaks and it seems to have given me a list that I am liking. Now I just need to find a way to plug pagination into it.

OR -- conversely -- to have the query by show me articles 100-200, or to specify a range of what I want to get. Then I can just create new pages with the PHP snippets for those articles.

Here is the code I am using:

$listlength="100";
$charlength="150";
$taxo_id = 79;
$content_type = 'story';
unset ($output);
$result1 = pager_query("SELECT n.title, n.nid, n.teaser, n.uid, n.created, u.name FROM {node} n INNER JOIN {users} u ON n.uid = u.uid 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 .= l($node->title, "node/$node->nid") . "<br>" . substr(strip_tags($node->teaser), 0, $charlength) . "... <em>Submitted by " . $node->name . "</em>" . "<br/><br/>";

}
$output .= "<br>";
print $output;