I have a view in Drupal that filters my content. It brings back 7 rows. All I want to return is the number or results returned(7). Is this possible?
I tried using the Vi
If using views_get_view in Views 3, you can use this snippet:
views_get_view
$view = views_get_view('MY_VIEW'); $view->set_display('MY_DISPLAY'); // Execute first $result = $view->preview('MY_DISPLAY'); // Output result only if rows > 0 if (count($view->result) > 0) { print $result; }