logo
Published on Technical articles on: Windows servers, Apache Web Server, MySQL, PHP, IIS (http://www.sitebuddy.com)

Display something between node teasers in a view

By chris
Created 16 Aug 2006 - 1:18am

Work 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;
}


Source URL:
http://www.sitebuddy.com/drupal/snippets/display_something_between_node_teasers_in_a_view