Hi,

(sorry for my bad english)

I want to create a view in wich there is a column that display for each node the results of another view (the node Id of each node of the first view is the argument of the second view).

Do you undersand me ?

For example :

View 1 : the titles of nodes of a specific content type are displayed.

View 2 : This view is shown in a block in each nodes of the specific content type. The node id is the argument of this view.

I want to display the count of results of views 2 in view 1. Is it possible ?

In the view 1, I have created a custom field php, but I don't understand what code I must write.

Can you help me ?

Thanks !

Comments

vstmusic’s picture

Solution :

<?php
$node_id = $data->node_vid;
$view_args = array($node_id);
$display_id = 'Bloc';
$view = views_get_view('name_of_the_view');
    if (!empty($view)) {
     $view->execute_display($display_id , $view_args);
}
$count = count($view->result);

print $count;
print " fois";
?>
DropSolutions’s picture

Title: How to display the total count of results of a view ? » Thanx vstmusic!!!
Assigned: Unassigned » DropSolutions
Status: Active » Closed (fixed)

Excellente!

This helped me alot!!!

intyms’s picture

Title: Thanx vstmusic!!! » Display the total count of results of a view
Assigned: DropSolutions » Unassigned