(Tips) Quick Views theming tricks in Drupal 5
Tips : Quick Views theming tricks in Drupal 5
Here is a quick views theming trick in drupal 5. Take a look on the function
- $node->view_name : the name of the view this node is being rendered in
- $node->position_in_view : the position within the view for this node
function phptemplate_views_view_nodes($view, $nodes, $type, $teasers = false, $links = true) {
static $count;
foreach ($nodes as $n) {
$node = node_load($n->nid);
$node->view_name = $view->name;
$node->position_in_view=$count[$view->name];
$count[$view->name]+=1;
$output .= node_view($node, $teasers, false, $links);
}
return $output;
}
Courtesy:- computerminds.co.uk
- guru's blog
- Login to post comments
![Drupal-6-Book-[Building Powerful and Robust Websites with Drupal 6].jpg](http://www.drupalranch.com/images/Drupal-6-Book-[Building%20Powerful%20and%20Robust%20Websites%20with%20Drupal%206].jpg)