Hello!
I use theme wizzard to group the views output by taxonomy terms (as diecribed here: http://drupal.org/node/42603 ).
Now I want to add a while loop to limit the output of nodes per Term (group) (Not for the nodes at all, that could be configured in the view itself).
But I dont understand the function, so I don't really know where to add the loop.
here is the code of the function:
<?php
/* This function goes in your template.php file
*/
function phptemplate_views_view_list_aktuelles_6($view, $nodes, $type) {
$fields = _views_get_fields();
$taken = array();
// Group our nodes
$set = array();
foreach ($nodes as $node) {
$set[$node->term_data_name][] = $node;
}
// Set up the fields in nicely named chunks.
foreach ($view->field as $id => $field) {
$field_name = $field['field'];
if (isset($taken[$field_name])) {
$field_name = $field['queryname'];
}
$taken[$field_name] = true;
$field_names[$id] = $field_name;
}
// Set up some variables that won't change.
$base_vars = array(
'view' => $view,
'view_type' => $type,
);
$output = '';
foreach ($set as $label => $nodes) {
$items = array();
foreach ($nodes as $i => $node) {
$vars = $base_vars;
$vars['node'] = $node;
$vars['count'] = $i;
$vars['stripe'] = $i % 2 ? 'even' : 'odd';