Display something between node teasers in a view
Submitted by chris on August 16, 2006 - 01:18. Drupal SnippetsWork in progess....
Drupal snippet to display something every X node in a view:
1) In the file views.module:
function theme_views_view_nodes($view, $nodes, $teasers = false, $links =
true) {
$num_nodes = 0;
$display_at = X;
foreach ($nodes as $n) {
$node = node_load($n->nid);
$output .= node_view($node, $teasers, false, $links);
if (++$num_nodes == $display_at) {
$output .= "test";
$num_nodes = 0;
}
}
return $output;
}

