How many nodes from a view?
Alex72RM - December 16, 2008 - 15:03
| Project: | Insert View |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hi,
I'm asking myself if is it possible to know how many nodes a "[view:name of view]"-tag return.
It should be very useful to build conditional php statements.
Thanks,
Alessandro

#1
In Drupal 5 you can use [view:name of view=x] where x is the number of node results to display.
(BTW, in Drupal 6, you cannot control the number of nodes in the tag. Instead, you would set the number of results to show in the view's display.)
#2
No, I need to know in advance how many nodes are in the view, 'cause I must perform a particular action when nodes number is zero.
#3
Why not put some code in the view on empty field ?
#4
Uhm... it should be a good solution, but I don't know how to manage the related output.
Have you some more hint?
Thanks a lot,
Alessandro
#5
Not really knowing what you need to do and also being no expert :)
insert view will display the view when it has content, or not
In views there is a field for empty text, which will take php, so if your view contains no results it displays the content of that field, so by putting your action in there you should achive what you want