Is there a way to display the last x nodes using a different node template, like node-columns.tpl.php, based on taxonomy with a list limit? I'm trying to include it on page.tpl.php.
The following (working) code displays the last 3 items from taxonomy id 11.
<?php
$listlength = 3; // [maximum] number of titles to show.
$taxo_id = 11; // the desired term ID.
$res = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.created FROM {node} n INNER JOIN term_node ON n.nid = term_node.nid WHERE term_node.tid = $taxo_id AND n.status = 1 ORDER BY n.created DESC"), 0, $listlength);
$output .= theme('node', $anode, $teaser = FALSE, $page = FALSE);
print $output;
?>
The following modified code did not work with the defined node template:
<?php
$listlength = 3; // [maximum] number of titles to show.
$taxo_id = 11; // the desired term ID.
$res = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.created FROM {node} n INNER JOIN term_node ON n.nid = term_node.nid WHERE term_node.tid = $taxo_id AND n.status = 1 ORDER BY n.created DESC"), 0, $listlength);
$output .= theme('node', $anode, $teaser = FALSE, $page = FALSE);
include 'node-columns.tpl.php'; /*load node-columns.tpl.php */
return;
print $output;
?>
I also tried modifying node.tpl.php to load a different template, but it did not work either. I'm sure it's because the taxo id isn't usable.